vim-patch:7.4.205

Problem:    ":mksession" writes command to move to second argument while it
            does not exist.  When it does exist the order might be wrong.
Solution:   Use ":argadd" for each argument instead of using ":args" with a
            list of names. (Nobuhiro Takasaki)

https://code.google.com/p/vim/source/detail?r=0ace3a24c2a0153f0aaf9b619d3958e7f486705f
This commit is contained in:
oni-link 2014-04-10 21:09:00 +02:00 committed by Thiago de Arruda
parent 30cd02301e
commit 644ccdafe0
2 changed files with 12 additions and 7 deletions

View File

@ -8254,9 +8254,10 @@ makeopens (
} }
/* the global argument list */ /* the global argument list */
if (ses_arglist(fd, "args", &global_alist.al_ga, if (ses_arglist(fd, "argglobal", &global_alist.al_ga,
!(ssop_flags & SSOP_CURDIR), &ssop_flags) == FAIL) !(ssop_flags & SSOP_CURDIR), &ssop_flags) == FAIL) {
return FAIL; return FAIL;
}
if (ssop_flags & SSOP_RESIZE) { if (ssop_flags & SSOP_RESIZE) {
/* Note: after the restore we still check it worked!*/ /* Note: after the restore we still check it worked!*/
@ -8755,10 +8756,12 @@ ses_arglist (
char_u *buf = NULL; char_u *buf = NULL;
char_u *s; char_u *s;
if (gap->ga_len == 0) if (fputs(cmd, fd) < 0 || put_eol(fd) == FAIL) {
return put_line(fd, "silent! argdel *");
if (fputs(cmd, fd) < 0)
return FAIL; return FAIL;
}
if (put_line(fd, "silent! argdel *") == FAIL) {
return FAIL;
}
for (i = 0; i < gap->ga_len; ++i) { for (i = 0; i < gap->ga_len; ++i) {
/* NULL file names are skipped (only happens when out of memory). */ /* NULL file names are skipped (only happens when out of memory). */
s = alist_name(&((aentry_T *)gap->ga_data)[i]); s = alist_name(&((aentry_T *)gap->ga_data)[i]);
@ -8770,14 +8773,15 @@ ses_arglist (
s = buf; s = buf;
} }
} }
if (fputs(" ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL) { if (fputs("argadd ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL
|| put_eol(fd) == FAIL) {
vim_free(buf); vim_free(buf);
return FAIL; return FAIL;
} }
vim_free(buf); vim_free(buf);
} }
} }
return put_eol(fd); return OK;
} }
/* /*

View File

@ -202,6 +202,7 @@ static char *(features[]) = {
static int included_patches[] = { static int included_patches[] = {
// Add new patch number below this line // Add new patch number below this line
205,
204, 204,
203, 203,
//202, //202,