0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.1.2315: not always using the right window when jumping to an error

Problem:    Not always using the right window when jumping to an error.
Solution:   Add the "uselast" flag in 'switchbuf'. (closes #1652)
This commit is contained in:
Bram Moolenaar
2019-11-17 18:09:38 +01:00
parent 7170b295b0
commit 539aa6b25e
6 changed files with 21 additions and 3 deletions

View File

@@ -3013,8 +3013,11 @@ qf_goto_win_with_qfl_file(int qf_fnum)
if (IS_QF_WINDOW(win))
{
// Didn't find it, go to the window before the quickfix
// window.
if (altwin != NULL)
// window, unless 'switchbuf' contains 'uselast': in this case we
// try to jump to the previously used window first.
if ((swb_flags & SWB_USELAST) && win_valid(prevwin))
win = prevwin;
else if (altwin != NULL)
win = altwin;
else if (curwin->w_prev != NULL)
win = curwin->w_prev;