diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-02-12 02:59:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-12 02:59:29 +0100 |
| commit | 9e9e4431c122f3b98fb0e7498b6572ceac0bca53 (patch) | |
| tree | a28f207390cdbbd27a468537e9065f3b8bfa1cbd /src/nvim/ex_cmds.c | |
| parent | 418947fcb34c46af895994ef9ba10a85d2d4c6c2 (diff) | |
| parent | 7da4d1561bd29615257a3f61073b5cf39f1f7463 (diff) | |
| download | rneovim-9e9e4431c122f3b98fb0e7498b6572ceac0bca53.tar.gz rneovim-9e9e4431c122f3b98fb0e7498b6572ceac0bca53.tar.bz2 rneovim-9e9e4431c122f3b98fb0e7498b6572ceac0bca53.zip | |
Merge #8001 from justinmk/vimpatches
Diffstat (limited to 'src/nvim/ex_cmds.c')
| -rw-r--r-- | src/nvim/ex_cmds.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 9cfcecf8ad..2873f76ce0 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2013,9 +2013,10 @@ int getfile(int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, } else other = (fnum != curbuf->b_fnum); - if (other) - ++no_wait_return; /* don't wait for autowrite message */ - if (other && !forceit && curbuf->b_nwindows == 1 && !P_HID(curbuf) + if (other) { + no_wait_return++; // don't wait for autowrite message + } + if (other && !forceit && curbuf->b_nwindows == 1 && !buf_hide(curbuf) && curbufIsChanged() && autowrite(curbuf, forceit) == FAIL) { if (p_confirm && p_write) dialog_changed(curbuf, FALSE); @@ -2032,17 +2033,19 @@ int getfile(int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, if (setpm) setpcmark(); if (!other) { - if (lnum != 0) + if (lnum != 0) { curwin->w_cursor.lnum = lnum; + } check_cursor_lnum(); beginline(BL_SOL | BL_FIX); - retval = 0; /* it's in the same file */ + retval = 0; // it's in the same file } else if (do_ecmd(fnum, ffname, sfname, NULL, lnum, - (P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0), - curwin) == OK) - retval = -1; /* opened another file */ - else - retval = 1; /* error encountered */ + (buf_hide(curbuf) ? ECMD_HIDE : 0) + + (forceit ? ECMD_FORCEIT : 0), curwin) == OK) { + retval = -1; // opened another file + } else { + retval = 1; // error encountered + } theend: xfree(free_me); |
