diff options
author | Daniel Hahler <git@thequod.de> | 2019-11-29 18:57:27 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-11-29 09:57:27 -0800 |
commit | 0a9ecf460a33ad1ee2b756d2ef0417e99bdfb988 (patch) | |
tree | 02491d08f4bbcc5c399ee28eb785c5fd4b357dcb /src/nvim/quickfix.c | |
parent | f33371c03f526ecbe2d6a1bec744fa37c1b2640c (diff) | |
download | rneovim-0a9ecf460a33ad1ee2b756d2ef0417e99bdfb988.tar.gz rneovim-0a9ecf460a33ad1ee2b756d2ef0417e99bdfb988.tar.bz2 rneovim-0a9ecf460a33ad1ee2b756d2ef0417e99bdfb988.zip |
vim-patch:8.1.2315: switchbuf=uselast #11480
Problem: Not always using the right window when jumping to an error.
Solution: Add the "uselast" flag in 'switchbuf'. (closes vim/vim#1652)
https://github.com/vim/vim/commit/539aa6b25eaea91dfd1a175cd053c0f259fa2e58
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 194cc5781b..5d30ca624f 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2595,8 +2595,11 @@ static void 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; |