This commit is contained in:
Justin M. Keyes
2018-02-12 01:32:52 +01:00
parent c68d89521f
commit 7da4d1561b
4 changed files with 52 additions and 44 deletions

View File

@@ -2013,8 +2013,9 @@ 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) {
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)
@@ -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,
(buf_hide(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);