diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-14 23:10:03 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-14 23:10:03 -0700 |
commit | 396c48d54ef313ca02e2e97849e51721094400cd (patch) | |
tree | 87857ac4a5a7f88e2ebc519e73df061f9ed2f8e1 /test/functional/legacy/tabline_spec.lua | |
parent | 968aa6e3ed0497ea99f123c74c5fd0f3880ccc63 (diff) | |
parent | 6134c1e8a39a5e61d0593613343a5923a86e3545 (diff) | |
download | rneovim-396c48d54ef313ca02e2e97849e51721094400cd.tar.gz rneovim-396c48d54ef313ca02e2e97849e51721094400cd.tar.bz2 rneovim-396c48d54ef313ca02e2e97849e51721094400cd.zip |
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'test/functional/legacy/tabline_spec.lua')
-rw-r--r-- | test/functional/legacy/tabline_spec.lua | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/test/functional/legacy/tabline_spec.lua b/test/functional/legacy/tabline_spec.lua new file mode 100644 index 0000000000..6b368d1857 --- /dev/null +++ b/test/functional/legacy/tabline_spec.lua @@ -0,0 +1,100 @@ +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 + [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('<C-V>Gl') + screen:expect([[ + {3:3x2 }| + {1:a} | + {1:b} | + {1:c}^ | + {0:~ }| + {0:~ }| + {2:-- VISUAL BLOCK --} | + ]]) + + feed('<Esc>1234') + screen:expect([[ + {3:1234 }| + a | + b | + ^c | + {0:~ }| + {0:~ }| + | + ]]) + + feed('<Esc>:set tabline=<CR>') + feed(':<CR>') + feed('1234') + screen:expect([[ + {2: + [No Name] }{3: }{4:1234}{3: }| + a | + b | + ^c | + {0:~ }| + {0:~ }| + : | + ]]) + end) +end) |