]> granicus.if.org Git - vim/commitdiff
patch 9.0.1195: restoring KeyTyped when building statusline not tested v9.0.1195
authorzeertzjq <zeertzjq@outlook.com>
Sat, 14 Jan 2023 11:46:49 +0000 (11:46 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 14 Jan 2023 11:46:49 +0000 (11:46 +0000)
Problem:    Restoring KeyTyped when building statusline not tested.
Solution:   Add a test.  Clean up and fix other tests. (closes #11815)

14 files changed:
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 [new file with mode: 0644]
src/testdir/dumps/Test_statusline_showcmd_5.dump [new file with mode: 0644]
src/testdir/dumps/Test_tabline_showcmd_1.dump
src/testdir/dumps/Test_tabline_showcmd_2.dump
src/testdir/dumps/Test_tabline_showcmd_3.dump [new file with mode: 0644]
src/testdir/dumps/Test_tabline_showcmd_4.dump [new file with mode: 0644]
src/testdir/test_statusline.vim
src/testdir/test_tabline.vim
src/testdir/test_window_cmd.vim
src/version.c

index 8c3cb62e4379a915076e7e270bf31e7187049948..e38b471657bccd0b7612f8eeedd655597cb6b5b1 100644 (file)
@@ -2043,6 +2043,6 @@ EXTERN int skip_win_fix_scroll INIT(= FALSE);
 // 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];
index 049e0f777d10c3806f7e9da3bb7d88fe18a2741a..626f60b2d711b55214be12ca50207a737b43f31a 100644 (file)
@@ -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
index c443662dd8eef9346ac00eab4e84d14b65a8b915..2844f129e8370d083e8ed6d2c7ec536bbe9a0a6c 100644 (file)
@@ -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
index 26ba3773e26b2abb13f450f44aebcbdfd220e2d8..049e0f777d10c3806f7e9da3bb7d88fe18a2741a 100644 (file)
@@ -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
diff --git a/src/testdir/dumps/Test_statusline_showcmd_4.dump b/src/testdir/dumps/Test_statusline_showcmd_4.dump
new file mode 100644 (file)
index 0000000..c443662
--- /dev/null
@@ -0,0 +1,6 @@
+|a+0&#ffffff0| @73
+|b| @73
+>c| @73
+|~+0#4040ff13&| @73
+|1+3#0000000&|2|3|4| @70
+| +0&&@74
diff --git a/src/testdir/dumps/Test_statusline_showcmd_5.dump b/src/testdir/dumps/Test_statusline_showcmd_5.dump
new file mode 100644 (file)
index 0000000..26ba377
--- /dev/null
@@ -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
index de8f62c1715b65ba18086174b9d6b1387980e1ed..40fea4ec079bb3917f02d80a9251d92726db86bb 100644 (file)
@@ -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| 
index b5a7283a8437488ac2837b4d384c577f8c192311..9765de449a72be229dd7b65003940ef408d59b95 100644 (file)
@@ -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| 
diff --git a/src/testdir/dumps/Test_tabline_showcmd_3.dump b/src/testdir/dumps/Test_tabline_showcmd_3.dump
new file mode 100644 (file)
index 0000000..3e29cda
--- /dev/null
@@ -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| 
diff --git a/src/testdir/dumps/Test_tabline_showcmd_4.dump b/src/testdir/dumps/Test_tabline_showcmd_4.dump
new file mode 100644 (file)
index 0000000..f9aac49
--- /dev/null
@@ -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| 
index 23613bfed37b9813642fb970b603e7758eaf4f0b..d06e903ad927af8ea3b1fce2dd1444b45069f7af 100644 (file)
@@ -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
index da738846f88495bca6cc54bea5be800ff5e41d9f..09adf2f68fe16c100b779cb0dda32e0cb9a51159 100644 (file)
@@ -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
index 3e841891f6f9eba38a7c35d1ff4f2422ad3e4a3f..a97ccba2dee6485a91f65b9dd12451863ac30e25 100644 (file)
@@ -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()
index 65c9e350cff9b9dd81e38df0bd9fe202a7aca9e7..7a028945b987359bde654797fe23fc449194010f 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1195,
 /**/
     1194,
 /**/