summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Pilling <robpilling@gmail.com>2022-12-13 12:26:09 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-13 12:26:09 +0000
commitcb94c910706fdd575cc25797d7858e084f1e3524 (patch)
treed677addda57ae7baf2427466bc203933c28823a9
parent6342e2c5a6570231aefabd8e34c2f2cb22f6927a (diff)
patch 9.0.1051: after a failed CTRL-W ] next command splits windowv9.0.1051
Problem: After a failed CTRL-W ] next command splits window. Solution: Reset postponed_split. (Rob Pilling, closes #11698)
-rw-r--r--src/testdir/test_window_cmd.vim13
-rw-r--r--src/version.c2
-rw-r--r--src/window.c2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index 0a4ae493e8..3e841891f6 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -1911,4 +1911,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/version.c b/src/version.c
index f72d537966..5248bcf503 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1051,
+/**/
1050,
/**/
1049,
diff --git a/src/window.c b/src/window.c
index 62b2a3f6fe..51745d2717 100644
--- a/src/window.c
+++ b/src/window.c
@@ -559,6 +559,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
@@ -674,6 +675,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