vim-patch:9.0.1051: after a failed CTRL-W ] next command splits window (#21400)

Problem:    After a failed CTRL-W ] next command splits window.
Solution:   Reset postponed_split. (Rob Pilling, closes vim/vim#11698)

cb94c91070

Co-authored-by: Rob Pilling <robpilling@gmail.com>
This commit is contained in:
zeertzjq
2022-12-13 22:43:54 +08:00
committed by GitHub
parent a6b05cb75d
commit 090048bec9
2 changed files with 15 additions and 0 deletions

View File

@@ -1811,4 +1811,17 @@ function Test_splitkeep_status()
call VerifyScreenDump(buf, 'Test_splitkeep_status_1', {})
endfunction
function Test_new_help_window_on_error()
help change.txt
execute "normal! /CTRL-@\<CR>"
silent! execute "normal! \<C-W>]"
let wincount = winnr('$')
help 'mod'
call assert_equal(wincount, winnr('$'))
call assert_equal(expand("<cword>"), "'mod'")
endfunction
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -494,6 +494,7 @@ newwindow:
// Execute the command right here, required when
// "wincmd ]" was used in a function.
do_nv_ident(Ctrl_RSB, NUL);
postponed_split = 0;
break;
// edit file name under cursor in a new window
@@ -594,6 +595,7 @@ wingotofile:
// Execute the command right here, required when
// "wincmd g}" was used in a function.
do_nv_ident('g', xchar);
postponed_split = 0;
break;
case 'f': // CTRL-W gf: "gf" in a new tab page