mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
vim-patch:8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
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 vim/vim#6215)
ec98e93a82
This commit is contained in:
@@ -6952,8 +6952,9 @@ void ex_helpgrep(exarg_T *eap)
|
|||||||
if (au_name != NULL) {
|
if (au_name != NULL) {
|
||||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
|
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
|
||||||
curbuf->b_fname, true, curbuf);
|
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,
|
||||||
// autocommands made "qi" invalid
|
// if the autocmd made the stack invalid, then just return.
|
||||||
|
if (!new_qi && IS_LL_STACK(qi) && qf_find_win_with_loclist(qi) == NULL) {
|
||||||
decr_quickfix_busy();
|
decr_quickfix_busy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -4625,6 +4625,24 @@ func Test_cquit()
|
|||||||
call assert_fails('-3cquit', 'E16:')
|
call assert_fails('-3cquit', 'E16:')
|
||||||
endfunc
|
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
|
||||||
|
|
||||||
" Test for adding an invalid entry with the quickfix window open and making
|
" Test for adding an invalid entry with the quickfix window open and making
|
||||||
" sure that the window contents are not changed
|
" sure that the window contents are not changed
|
||||||
func Test_add_invalid_entry_with_qf_window()
|
func Test_add_invalid_entry_with_qf_window()
|
||||||
|
Reference in New Issue
Block a user