From 644ccdafe01df76c47f2a6c74a4a55f64602e3db Mon Sep 17 00:00:00 2001 From: oni-link Date: Thu, 10 Apr 2014 21:09:00 +0200 Subject: 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 --- src/ex_docmd.c | 18 +++++++++++------- src/version.c | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 4a03b6e283..e8064b1109 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8254,9 +8254,10 @@ makeopens ( } /* the global argument list */ - if (ses_arglist(fd, "args", &global_alist.al_ga, - !(ssop_flags & SSOP_CURDIR), &ssop_flags) == FAIL) + if (ses_arglist(fd, "argglobal", &global_alist.al_ga, + !(ssop_flags & SSOP_CURDIR), &ssop_flags) == FAIL) { return FAIL; + } if (ssop_flags & SSOP_RESIZE) { /* Note: after the restore we still check it worked!*/ @@ -8755,10 +8756,12 @@ ses_arglist ( char_u *buf = NULL; char_u *s; - if (gap->ga_len == 0) - return put_line(fd, "silent! argdel *"); - if (fputs(cmd, fd) < 0) + if (fputs(cmd, fd) < 0 || put_eol(fd) == FAIL) { + return FAIL; + } + if (put_line(fd, "silent! argdel *") == FAIL) { return FAIL; + } for (i = 0; i < gap->ga_len; ++i) { /* NULL file names are skipped (only happens when out of memory). */ s = alist_name(&((aentry_T *)gap->ga_data)[i]); @@ -8770,14 +8773,15 @@ ses_arglist ( 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); return FAIL; } vim_free(buf); } } - return put_eol(fd); + return OK; } /* diff --git a/src/version.c b/src/version.c index c602d192c5..5a03359fec 100644 --- a/src/version.c +++ b/src/version.c @@ -202,6 +202,7 @@ static char *(features[]) = { static int included_patches[] = { // Add new patch number below this line + 205, 204, 203, //202, -- cgit