changeset 31726:122cfa668b95 v9.0.1195

patch 9.0.1195: restoring KeyTyped when building statusline not tested Commit: https://github.com/vim/vim/commit/378e6c03f98efc88e8c2675e05a548f9bb7889a1 Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Jan 14 11:46:49 2023 +0000 patch 9.0.1195: restoring KeyTyped when building statusline not tested Problem: Restoring KeyTyped when building statusline not tested. Solution: Add a test. Clean up and fix other tests. (closes https://github.com/vim/vim/issues/11815)
author Bram Moolenaar <Bram@vim.org>
date Sat, 14 Jan 2023 13:00:05 +0100
parents fe59eda87b30
children 2b50a7f0feec
files src/globals.h src/testdir/dumps/Test_statusline_showcmd_1.dump src/testdir/dumps/Test_statusline_showcmd_2.dump src/testdir/dumps/Test_statusline_showcmd_3.dump src/testdir/dumps/Test_statusline_showcmd_4.dump src/testdir/dumps/Test_statusline_showcmd_5.dump src/testdir/dumps/Test_tabline_showcmd_1.dump src/testdir/dumps/Test_tabline_showcmd_2.dump src/testdir/dumps/Test_tabline_showcmd_3.dump src/testdir/dumps/Test_tabline_showcmd_4.dump src/testdir/test_statusline.vim src/testdir/test_tabline.vim src/testdir/test_window_cmd.vim src/version.c
diffstat 14 files changed, 102 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/globals.h
+++ b/src/globals.h
@@ -2043,6 +2043,6 @@ EXTERN int skip_win_fix_scroll INIT(= FA
 // Skip update_topline() call while executing win_fix_scroll().
 EXTERN int skip_update_topline INIT(= FALSE);
 
-// 'showcmd' buffer shared between normal.c and statusline.c
+// 'showcmd' buffer shared between normal.c and statusline code
 #define SHOWCMD_BUFLEN (SHOWCMD_COLS + 1 + 30)
 EXTERN char_u showcmd_buf[SHOWCMD_BUFLEN];
--- a/src/testdir/dumps/Test_statusline_showcmd_1.dump
+++ b/src/testdir/dumps/Test_statusline_showcmd_1.dump
@@ -1,6 +1,6 @@
-|a+0&#e0e0e08| +0&#ffffff0@73
-|b+0&#e0e0e08| +0&#ffffff0@73
-|c+0&#e0e0e08> +0&#ffffff0@73
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |a|-@59
+>c+0#0000000#ffffff0| @73
 |~+0#4040ff13&| @73
-|3+3#0000000&|x|2| @71
-|-+2&&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@56
+|~| @73
+|g+3#0000000&| @73
+| +0&&@74
--- a/src/testdir/dumps/Test_statusline_showcmd_2.dump
+++ b/src/testdir/dumps/Test_statusline_showcmd_2.dump
@@ -1,6 +1,6 @@
-|a+0&#ffffff0| @73
+>a+0&#ffffff0| @73
 |b| @73
->c| @73
+|c| @73
 |~+0#4040ff13&| @73
-|1+3#0000000&|2|3|4| @70
+| +3#0000000&@74
 | +0&&@74
--- a/src/testdir/dumps/Test_statusline_showcmd_3.dump
+++ b/src/testdir/dumps/Test_statusline_showcmd_3.dump
@@ -1,6 +1,6 @@
-|a+0&#ffffff0| @73
-|b| @73
->c| @73
+|a+0&#e0e0e08| +0&#ffffff0@73
+|b+0&#e0e0e08| +0&#ffffff0@73
+|c+0&#e0e0e08> +0&#ffffff0@73
 |~+0#4040ff13&| @73
-|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @32|1|2|3|4| @6|3|,|1| @11|A|l@1
-|:+0&&| @73
+|3+3#0000000&|x|2| @71
+|-+2&&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@56
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_statusline_showcmd_4.dump
@@ -0,0 +1,6 @@
+|a+0&#ffffff0| @73
+|b| @73
+>c| @73
+|~+0#4040ff13&| @73
+|1+3#0000000&|2|3|4| @70
+| +0&&@74
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_statusline_showcmd_5.dump
@@ -0,0 +1,6 @@
+|a+0&#ffffff0| @73
+|b| @73
+>c| @73
+|~+0#4040ff13&| @73
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @32|1|2|3|4| @6|3|,|1| @11|A|l@1
+|:+0&&| @73
--- a/src/testdir/dumps/Test_tabline_showcmd_1.dump
+++ b/src/testdir/dumps/Test_tabline_showcmd_1.dump
@@ -1,6 +1,6 @@
-| +2&#ffffff0|+| |[|N|o| |N|a|m|e|]| | +1&&@51|3+8#0000001#e0e0e08|x|2| +1#0000000#ffffff0@6
-|a+0&#e0e0e08| +0&#ffffff0@73
-|b+0&#e0e0e08| +0&#ffffff0@73
-|c+0&#e0e0e08> +0&#ffffff0@73
+|g+1&#ffffff0| @73
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |a|-@59
+>c+0#0000000#ffffff0| @73
 |~+0#4040ff13&| @73
-|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@38|3|,|2| @10|A|l@1| 
+|~| @73
+| +0#0000000&@56|3|,|1| @10|A|l@1| 
--- a/src/testdir/dumps/Test_tabline_showcmd_2.dump
+++ b/src/testdir/dumps/Test_tabline_showcmd_2.dump
@@ -1,6 +1,6 @@
-| +2&#ffffff0|+| |[|N|o| |N|a|m|e|]| | +1&&@51|1+8#0000001#e0e0e08|2|3|4| +1#0000000#ffffff0@5
-|a+0&&| @73
+| +1&#ffffff0@74
+>a+0&&| @73
 |b| @73
->c| @73
+|c| @73
 |~+0#4040ff13&| @73
-| +0#0000000&@56|3|,|1| @10|A|l@1| 
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_tabline_showcmd_3.dump
@@ -0,0 +1,6 @@
+|3+1&#ffffff0|x|2| @71
+|a+0&#e0e0e08| +0&#ffffff0@73
+|b+0&#e0e0e08| +0&#ffffff0@73
+|c+0&#e0e0e08> +0&#ffffff0@73
+|~+0#4040ff13&| @73
+|-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@38|3|,|2| @10|A|l@1| 
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_tabline_showcmd_4.dump
@@ -0,0 +1,6 @@
+|1+1&#ffffff0|2|3|4| @70
+|a+0&&| @73
+|b| @73
+>c| @73
+|~+0#4040ff13&| @73
+| +0#0000000&@56|3|,|1| @10|A|l@1| 
--- a/src/testdir/test_statusline.vim
+++ b/src/testdir/test_statusline.vim
@@ -569,22 +569,41 @@ func Test_statusline_showcmd()
   CheckScreendump
 
   let lines =<< trim END
+    func MyStatusLine()
+      return '%S'
+    endfunc
+
     set laststatus=2
-    set statusline=%S
+    set statusline=%!MyStatusLine()
     set showcmdloc=statusline
     call setline(1, ['a', 'b', 'c'])
+    set foldopen+=jump
+    1,2fold
+    3
   END
   call writefile(lines, 'XTest_statusline', 'D')
 
   let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 6})
-  call feedkeys("\<C-V>Gl", "xt")
+
+  call term_sendkeys(buf, "g")
   call VerifyScreenDump(buf, 'Test_statusline_showcmd_1', {})
 
-  call feedkeys("\<Esc>1234", "xt")
+  " typing "gg" should open the fold
+  call term_sendkeys(buf, "g")
   call VerifyScreenDump(buf, 'Test_statusline_showcmd_2', {})
 
-  call feedkeys("\<Esc>:set statusline=\<CR>:\<CR>1234", "xt")
+  call term_sendkeys(buf, "\<C-V>Gl")
   call VerifyScreenDump(buf, 'Test_statusline_showcmd_3', {})
+
+  call term_sendkeys(buf, "\<Esc>1234")
+  call VerifyScreenDump(buf, 'Test_statusline_showcmd_4', {})
+
+  call term_sendkeys(buf, "\<Esc>:set statusline=\<CR>")
+  call term_sendkeys(buf, ":\<CR>")
+  call term_sendkeys(buf, "1234")
+  call VerifyScreenDump(buf, 'Test_statusline_showcmd_5', {})
+
+  call StopVimInTerminal(buf)
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
--- a/src/testdir/test_tabline.vim
+++ b/src/testdir/test_tabline.vim
@@ -165,19 +165,41 @@ func Test_tabline_showcmd()
   CheckScreendump
 
   let lines =<< trim END
+    func MyTabLine()
+      return '%S'
+    endfunc
+
     set showtabline=2
+    set tabline=%!MyTabLine()
     set showcmdloc=tabline
     call setline(1, ['a', 'b', 'c'])
+    set foldopen+=jump
+    1,2fold
+    3
   END
   call writefile(lines, 'XTest_tabline', 'D')
 
   let buf = RunVimInTerminal('-S XTest_tabline', {'rows': 6})
 
-  call feedkeys("\<C-V>Gl", "xt")
+  call term_sendkeys(buf, "g")
   call VerifyScreenDump(buf, 'Test_tabline_showcmd_1', {})
 
-  call feedkeys("\<Esc>1234", "xt")
+  " typing "gg" should open the fold
+  call term_sendkeys(buf, "g")
   call VerifyScreenDump(buf, 'Test_tabline_showcmd_2', {})
+
+  call term_sendkeys(buf, "\<C-V>Gl")
+  call VerifyScreenDump(buf, 'Test_tabline_showcmd_3', {})
+
+  call term_sendkeys(buf, "\<Esc>1234")
+  call VerifyScreenDump(buf, 'Test_tabline_showcmd_4', {})
+
+  call term_sendkeys(buf, "\<Esc>:set tabline=\<CR>")
+  call term_sendkeys(buf, ":\<CR>")
+  call term_sendkeys(buf, "1234")
+  call VerifyScreenDump(buf, 'Test_tabline_showcmd_5', {})
+
+  call StopVimInTerminal(buf)
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -1861,6 +1861,8 @@ function Test_splitkeep_callback()
 
   call term_sendkeys(buf, ":quit\<CR>Gt")
   call VerifyScreenDump(buf, 'Test_splitkeep_callback_4', {})
+
+  call StopVimInTerminal(buf)
 endfunc
 
 function Test_splitkeep_fold()
@@ -1891,6 +1893,8 @@ function Test_splitkeep_fold()
 
   call term_sendkeys(buf, ":wincmd k\<CR>:quit\<CR>")
   call VerifyScreenDump(buf, 'Test_splitkeep_fold_4', {})
+
+  call StopVimInTerminal(buf)
 endfunction
 
 function Test_splitkeep_status()
@@ -1909,6 +1913,8 @@ function Test_splitkeep_status()
 
   call term_sendkeys(buf, ":call win_move_statusline(win, 1)\<CR>")
   call VerifyScreenDump(buf, 'Test_splitkeep_status_1', {})
+
+  call StopVimInTerminal(buf)
 endfunction
 
 function Test_new_help_window_on_error()
--- 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 */
 /**/
+    1195,
+/**/
     1194,
 /**/
     1193,