aboutsummaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authoroni-link <knil.ino@gmail.com>2014-04-10 21:09:00 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-14 09:53:02 -0300
commit644ccdafe01df76c47f2a6c74a4a55f64602e3db (patch)
tree926f0d35459e009760afab58500f942c9bd97e00 /src/ex_docmd.c
parent30cd02301e5a55215a82cb2007a2fd631ae6fc33 (diff)
downloadrneovim-644ccdafe01df76c47f2a6c74a4a55f64602e3db.tar.gz
rneovim-644ccdafe01df76c47f2a6c74a4a55f64602e3db.tar.bz2
rneovim-644ccdafe01df76c47f2a6c74a4a55f64602e3db.zip
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
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c18
1 files changed, 11 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;
}
/*