aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/tabline_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /test/functional/ui/tabline_spec.lua
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/ui/tabline_spec.lua')
-rw-r--r--test/functional/ui/tabline_spec.lua73
1 files changed, 61 insertions, 12 deletions
diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua
index 2cdec62d01..befdb7c5d1 100644
--- a/test/functional/ui/tabline_spec.lua
+++ b/test/functional/ui/tabline_spec.lua
@@ -1,6 +1,9 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, command, eq = helpers.clear, helpers.command, helpers.eq
+local insert = helpers.insert
+local meths = helpers.meths
+local assert_alive = helpers.assert_alive
describe('ui/ext_tabline', function()
local screen
@@ -92,6 +95,10 @@ describe("tabline", function()
clear()
screen = Screen.new(42, 5)
screen:attach()
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue}; -- NonText
+ [1] = {reverse = true}; -- TabLineFill
+ })
end)
it('redraws when tabline option is set', function()
@@ -100,24 +107,18 @@ describe("tabline", function()
screen:expect{grid=[[
{1:asdf }|
^ |
- {2:~ }|
- {2:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], attr_ids={
- [1] = {reverse = true};
- [2] = {bold = true, foreground = Screen.colors.Blue1};
- }}
+ ]]}
command('set tabline=jkl')
screen:expect{grid=[[
{1:jkl }|
^ |
- {2:~ }|
- {2:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], attr_ids={
- [1] = {reverse = true};
- [2] = {bold = true, foreground = Screen.colors.Blue};
- }}
+ ]]}
end)
it('click definitions do not leak memory #21765', function()
@@ -125,4 +126,52 @@ describe("tabline", function()
command('set showtabline=2')
command('redrawtabline')
end)
+
+ it('clicks work with truncated double-width label #24187', function()
+ insert('tab1')
+ command('tabnew')
+ insert('tab2')
+ command('tabprev')
+ meths.set_option_value('tabline', '%1T口口%2Ta' .. ('b'):rep(38) .. '%999Xc', {})
+ screen:expect{grid=[[
+ {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ tab^1 |
+ {0:~ }|
+ {0:~ }|
+ |
+ ]]}
+ assert_alive()
+ meths.input_mouse('left', 'press', '', 0, 0, 1)
+ screen:expect{grid=[[
+ {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ tab^2 |
+ {0:~ }|
+ {0:~ }|
+ |
+ ]]}
+ meths.input_mouse('left', 'press', '', 0, 0, 0)
+ screen:expect{grid=[[
+ {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ tab^1 |
+ {0:~ }|
+ {0:~ }|
+ |
+ ]]}
+ meths.input_mouse('left', 'press', '', 0, 0, 39)
+ screen:expect{grid=[[
+ {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ tab^2 |
+ {0:~ }|
+ {0:~ }|
+ |
+ ]]}
+ meths.input_mouse('left', 'press', '', 0, 0, 40)
+ screen:expect{grid=[[
+ tab^1 |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]]}
+ end)
end)