From 5b89d480e30367259f82680945572b1406219da5 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 15 Dec 2022 21:23:28 +0100 Subject: vim-patch:9.0.1061: cannot display 'showcmd' somewhere else Problem: Cannot display 'showcmd' somewhere else. Solution: Add the 'showcmdloc' option. (Luuk van Baal, closes vim/vim#11684) https://github.com/vim/vim/commit/ba936f6f4e85cc1408bc3967f9fd7665d948909b Co-authored-by: Luuk van Baal --- test/functional/legacy/tabline_spec.lua | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 test/functional/legacy/tabline_spec.lua (limited to 'test/functional/legacy/tabline_spec.lua') diff --git a/test/functional/legacy/tabline_spec.lua b/test/functional/legacy/tabline_spec.lua new file mode 100644 index 0000000000..d858f137c5 --- /dev/null +++ b/test/functional/legacy/tabline_spec.lua @@ -0,0 +1,53 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear = helpers.clear +local exec = helpers.exec +local feed = helpers.feed + +before_each(clear) + +describe('tabline', function() + local screen + + before_each(function() + screen = Screen.new(50, 7) + screen:attach() + end) + + -- oldtest: Test_tabline_showcmd() + it('showcmdloc=tabline works', function() + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {background = Screen.colors.LightGrey}, -- Visual + [2] = {bold = true}, -- MoreMsg, TabLineSel + [3] = {reverse = true}, -- TabLineFill + [4] = {background = Screen.colors.LightGrey, underline = true}, -- TabLine + }) + exec([[ + set showcmd + set showtabline=2 + set showcmdloc=tabline + call setline(1, ['a', 'b', 'c']) + ]]) + feed('Gl') + screen:expect([[ + {2: + [No Name] }{3: }{4:3x2}{3: }| + {1:a} | + {1:b} | + {1:c}^ | + {0:~ }| + {0:~ }| + {2:-- VISUAL BLOCK --} | + ]]) + feed('1234') + screen:expect([[ + {2: + [No Name] }{3: }{4:1234}{3: }| + a | + b | + ^c | + {0:~ }| + {0:~ }| + | + ]]) + end) +end) -- cgit From d98e4e4b2ecd84162635a5f354dc4ddc6a49abc5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 14 Jan 2023 19:52:44 +0800 Subject: vim-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 vim/vim#11815) https://github.com/vim/vim/commit/378e6c03f98efc88e8c2675e05a548f9bb7889a1 --- test/functional/legacy/tabline_spec.lua | 51 +++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'test/functional/legacy/tabline_spec.lua') diff --git a/test/functional/legacy/tabline_spec.lua b/test/functional/legacy/tabline_spec.lua index d858f137c5..6b368d1857 100644 --- a/test/functional/legacy/tabline_spec.lua +++ b/test/functional/legacy/tabline_spec.lua @@ -22,16 +22,49 @@ describe('tabline', function() [2] = {bold = true}, -- MoreMsg, TabLineSel [3] = {reverse = true}, -- TabLineFill [4] = {background = Screen.colors.LightGrey, underline = true}, -- TabLine + [5] = {background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue}, -- Folded }) exec([[ + func MyTabLine() + return '%S' + endfunc + set showcmd set showtabline=2 + set tabline=%!MyTabLine() set showcmdloc=tabline call setline(1, ['a', 'b', 'c']) + set foldopen+=jump + 1,2fold + 3 + ]]) + + feed('g') + screen:expect([[ + {3:g }| + {5:+-- 2 lines: a···································}| + ^c | + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + + -- typing "gg" should open the fold + feed('g') + screen:expect([[ + {3: }| + ^a | + b | + c | + {0:~ }| + {0:~ }| + | ]]) + feed('Gl') screen:expect([[ - {2: + [No Name] }{3: }{4:3x2}{3: }| + {3:3x2 }| {1:a} | {1:b} | {1:c}^ | @@ -39,9 +72,10 @@ describe('tabline', function() {0:~ }| {2:-- VISUAL BLOCK --} | ]]) + feed('1234') screen:expect([[ - {2: + [No Name] }{3: }{4:1234}{3: }| + {3:1234 }| a | b | ^c | @@ -49,5 +83,18 @@ describe('tabline', function() {0:~ }| | ]]) + + feed(':set tabline=') + feed(':') + feed('1234') + screen:expect([[ + {2: + [No Name] }{3: }{4:1234}{3: }| + a | + b | + ^c | + {0:~ }| + {0:~ }| + : | + ]]) end) end) -- cgit