aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-13 22:43:54 +0800
committerGitHub <noreply@github.com>2022-12-13 22:43:54 +0800
commit090048bec9f80c46a6ce6ff05a419b15bc4bf028 (patch)
tree06352251e9055fdcb221f8a10c11e7d270823501
parenta6b05cb75d330dd995d3ad21ee08bb0a2cfcae74 (diff)
downloadrneovim-090048bec9f80c46a6ce6ff05a419b15bc4bf028.tar.gz
rneovim-090048bec9f80c46a6ce6ff05a419b15bc4bf028.tar.bz2
rneovim-090048bec9f80c46a6ce6ff05a419b15bc4bf028.zip
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) https://github.com/vim/vim/commit/cb94c910706fdd575cc25797d7858e084f1e3524 Co-authored-by: Rob Pilling <robpilling@gmail.com>
-rw-r--r--src/nvim/testdir/test_window_cmd.vim13
-rw-r--r--src/nvim/window.c2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim
index 6e8368f71d..ab63506d3c 100644
--- a/src/nvim/testdir/test_window_cmd.vim
+++ b/src/nvim/testdir/test_window_cmd.vim
@@ -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
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 05694a8b6d..d026f4551a 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -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