summaryrefslogtreecommitdiffstats
path: root/src/quickfix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-17 18:09:38 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-17 18:09:38 +0100
commit539aa6b25eaea91dfd1a175cd053c0f259fa2e58 (patch)
treeb99f4cb24f73325ab336faf8beb0faadc6e01592 /src/quickfix.c
parent7170b295b06e3168424985530d8477ed2e058b67 (diff)
patch 8.1.2315: not always using the right window when jumping to an errorv8.1.2315
Problem: Not always using the right window when jumping to an error. Solution: Add the "uselast" flag in 'switchbuf'. (closes #1652)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r--src/quickfix.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index a5d307ea79..aa4e765908 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -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;