]> granicus.if.org Git - vim/commitdiff
patch 9.0.1051: after a failed CTRL-W ] next command splits window v9.0.1051
authorRob Pilling <robpilling@gmail.com>
Tue, 13 Dec 2022 12:26:09 +0000 (12:26 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 13 Dec 2022 12:26:09 +0000 (12:26 +0000)
Problem:    After a failed CTRL-W ] next command splits window.
Solution:   Reset postponed_split. (Rob Pilling, closes #11698)

src/testdir/test_window_cmd.vim
src/version.c
src/window.c

index 0a4ae493e8999ccb0e8fa652870a432d590ef4d1..3e841891f6f9eba38a7c35d1ff4f2422ad3e4a3f 100644 (file)
@@ -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
index f72d53796603d8d6410ed83cecbe1c3065e07d0d..5248bcf503a944f261a7e046d1c1387c958f9cc5 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1051,
 /**/
     1050,
 /**/
index 62b2a3f6fee97e6f95d5d25fe7b17613f2e7b368..51745d271718433852e1877397ac85c524b4946e 100644 (file)
@@ -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