diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-08 19:35:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-08 19:35:59 +0200 |
commit | ec98e93a82379ca9289d8021aec374aa6798afef (patch) | |
tree | 127121782b80d461eb8d3d40cb2cc4f84949a27e /src | |
parent | 7ba5a7eff335dcce25afaa154f32eeadb6014b61 (diff) |
patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topicv8.2.0934
Problem: Running lhelpgrep twice in a help window doesn't jump to the help
topic.
Solution: Check whether any window with the location list is present.
(Yegappan Lakshmanan, closes #6215)
Diffstat (limited to 'src')
-rw-r--r-- | src/quickfix.c | 5 | ||||
-rw-r--r-- | src/testdir/test_quickfix.vim | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 0da8ea27f1..35a66dc93c 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -7963,9 +7963,10 @@ ex_helpgrep(exarg_T *eap) { apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, curbuf->b_fname, TRUE, curbuf); - if (!new_qi && IS_LL_STACK(qi) && qf_find_buf(qi) == NULL) + // When adding a location list to an existing location list stack, + // if the autocmd made the stack invalid, then just return. + if (!new_qi && IS_LL_STACK(qi) && qf_find_win_with_loclist(qi) == NULL) { - // autocommands made "qi" invalid decr_quickfix_busy(); return; } diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 7587d979e5..03b374fb10 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -4918,4 +4918,22 @@ func Test_qftextfunc() call Xtest_qftextfunc('l') endfunc +" Running :lhelpgrep command more than once in a help window, doesn't jump to +" the help topic +func Test_lhelpgrep_from_help_window() + call mkdir('Xtestdir/doc', 'p') + call writefile(['window'], 'Xtestdir/doc/a.txt') + call writefile(['buffer'], 'Xtestdir/doc/b.txt') + let save_rtp = &rtp + let &rtp = 'Xtestdir' + lhelpgrep window + lhelpgrep buffer + call assert_equal('b.txt', fnamemodify(@%, ":p:t")) + lhelpgrep window + call assert_equal('a.txt', fnamemodify(@%, ":p:t")) + let &rtp = save_rtp + call delete('Xtestdir', 'rf') + new | only! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 54369e4a73..04f61c93ec 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 934, +/**/ 933, /**/ 932, |