vim-patch:8.0.0621: :stag does not respect 'switchbuf'

Problem:    The ":stag" command does not respect 'switchbuf'.
Solution:   Check 'switchbuf' for tag commands that may open a new window.
            (Ingo Karkat, closes vim/vim#1681)  Define macros for the return values
            of getfile().
8ad80dea08
This commit is contained in:
Jan Edmund Lazo
2018-06-21 09:59:14 -04:00
parent 7ae7da8fb9
commit bf61885cb4
7 changed files with 124 additions and 37 deletions

View File

@@ -1901,10 +1901,10 @@ int buflist_getfile(int n, linenr_T lnum, int options, int forceit)
}
}
++RedrawingDisabled;
if (getfile(buf->b_fnum, NULL, NULL, (options & GETF_SETMARK),
lnum, forceit) <= 0) {
--RedrawingDisabled;
RedrawingDisabled++;
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
(options & GETF_SETMARK), lnum, forceit))) {
RedrawingDisabled--;
/* cursor is at to BOL and w_cursor.lnum is checked due to getfile() */
if (!p_sol && col != 0) {
@@ -1915,7 +1915,7 @@ int buflist_getfile(int n, linenr_T lnum, int options, int forceit)
}
return OK;
}
--RedrawingDisabled;
RedrawingDisabled--;
return FAIL;
}