refactor(tests): use new global defaults instead of set_default_attr_ids

This will be done in batches.
This commit is contained in:
bfredl 2024-03-26 21:23:36 +01:00
parent 0c0be09eab
commit 35f2bb05a5
9 changed files with 713 additions and 812 deletions

View File

@ -1265,15 +1265,6 @@ describe('cmdheight=0', function()
before_each(function()
clear()
screen = Screen.new(25, 5)
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue },
[2] = { bold = true, reverse = true },
[3] = { bold = true },
[4] = { foreground = Screen.colors.White, background = Screen.colors.Red },
[5] = { foreground = Screen.colors.SeaGreen4, bold = true },
[6] = { reverse = true },
[7] = { background = Screen.colors.Yellow },
}
screen:attach()
end)
@ -1302,7 +1293,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*2
{2:[No Name] }|
{3:[No Name] }|
|
]],
}
@ -1314,7 +1305,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*3
{2:[No Name] }|
{3:[No Name] }|
]],
}
end)
@ -1364,7 +1355,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*3
{3:-- INSERT --} |
{5:-- INSERT --} |
]],
}
feed('<Esc>')
@ -1400,7 +1391,7 @@ describe('cmdheight=0', function()
grid = [[
|
{1:~ }|
{2: }|
{3: }|
:call input("foo >") |
foo >^ |
]],
@ -1422,26 +1413,26 @@ describe('cmdheight=0', function()
feed(':split<CR>')
screen:expect {
grid = [[
{2: }|
{3: }|
:split |
{4:E36: Not enough room} |
{5:Press ENTER or type comma}|
{5:nd to continue}^ |
{9:E36: Not enough room} |
{6:Press ENTER or type comma}|
{6:nd to continue}^ |
]],
}
feed('<CR>')
screen:expect {
grid = [[
{3:foo }|
{5:foo }|
^ |
{1:~ }|*2
{2:[No Name] }|
{3:[No Name] }|
]],
}
feed(':')
screen:expect {
grid = [[
{3:foo }|
{5:foo }|
|
{1:~ }|*2
:^ |
@ -1450,10 +1441,10 @@ describe('cmdheight=0', function()
feed('<Esc>')
screen:expect {
grid = [[
{3:foo }|
{5:foo }|
^ |
{1:~ }|*2
{2:[No Name] }|
{3:[No Name] }|
]],
showmode = {},
}
@ -1488,16 +1479,16 @@ describe('cmdheight=0', function()
grid = [[
fo^o |
{1:~ }|*3
{2:[No Name] [+] }|
{3:[No Name] [+] }|
]],
}
feed(':%s/foo/bar/gc<CR>')
screen:expect {
grid = [[
{6:foo} |
{2:foo} |
{1:~ }|*3
{5:replace wi...q/l/^E/^Y)?}^ |
{6:replace wi...q/l/^E/^Y)?}^ |
]],
}
@ -1506,7 +1497,7 @@ describe('cmdheight=0', function()
grid = [[
^bar |
{1:~ }|*3
{2:[No Name] [+] }|
{3:[No Name] [+] }|
]],
}
@ -1525,7 +1516,7 @@ describe('cmdheight=0', function()
feed('iaabbaa<esc>/aa<cr>')
screen:expect {
grid = [[
{7:^aa}bb{7:aa} |
{10:^aa}bb{10:aa} |
{1:~ }|*4
]],
}
@ -1584,7 +1575,7 @@ describe('cmdheight=0', function()
[2:-------------------------]|*4
[3:-------------------------]|
## grid 2
{6:p} |
{2:p} |
{1:~ }|*4
## grid 3
/p^ |
@ -1610,7 +1601,7 @@ describe('cmdheight=0', function()
]])
feed(':')
screen:expect([[
{3:c :}|
{5:c :}|
|
{1:~ }|*2
:^ |
@ -1618,14 +1609,14 @@ describe('cmdheight=0', function()
feed('echo')
-- not redrawn yet
screen:expect([[
{3:c :}|
{5:c :}|
|
{1:~ }|*2
:echo^ |
]])
command('redrawstatus')
screen:expect([[
{3:c :echo}|
{5:c :echo}|
|
{1:~ }|*2
:echo^ |
@ -1646,7 +1637,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ |
{1:~ }{1:~ }|*3
{2:[No Name] }{1:~ }|
{3:[No Name] }{1:~ }|
{1:~ }|
{1:~ }{1:~ }|*3
]])
@ -1654,7 +1645,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ |
{1:~ }{1:~ }|
{2:[No Name] }{1:~ }|
{3:[No Name] }{1:~ }|
{1:~ }|
{1:~ }{1:~ }|*5
]])
@ -1664,7 +1655,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ |
{1:~ }{1:~ }|*3
{2:[No Name] }{1:~ }|
{3:[No Name] }{1:~ }|
{1:~ }|
{1:~ }{1:~ }|*3
]])
@ -1686,7 +1677,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ |
{1:~ }|*2
{2:[No Name] }|
{3:[No Name] }|
|
]])
command('set cmdheight=0')
@ -1694,7 +1685,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*3
{2:[No Name] }|
{3:[No Name] }|
]],
}
command('resize -1')
@ -1702,7 +1693,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*2
{2:[No Name] }|
{3:[No Name] }|
|
]],
}
@ -1710,7 +1701,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ |
{1:~ }|*3
{2:[No Name] }|
{3:[No Name] }|
]])
end)

View File

@ -280,21 +280,16 @@ end)
it('typing a simplifiable key at hit-enter prompt triggers mapping vim-patch:8.2.0839', function()
local screen = Screen.new(60, 8)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[2] = { bold = true, reverse = true }, -- MsgSeparator
[3] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg
})
screen:attach()
command([[nnoremap <C-6> <Cmd>echo 'hit ctrl-6'<CR>]])
feed_command('ls')
screen:expect([[
|
{1:~ }|*3
{2: }|
{3: }|
:ls |
1 %a "[No Name]" line 1 |
{3:Press ENTER or type command to continue}^ |
{6:Press ENTER or type command to continue}^ |
]])
feed('<C-6>')
screen:expect([[
@ -331,12 +326,6 @@ describe('input non-printable chars', function()
it("doesn't crash when echoing them back", function()
write_file('Xtest-overwrite', [[foobar]])
local screen = Screen.new(60, 8)
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[3] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[4] = { bold = true, reverse = true },
}
screen:attach()
command('set shortmess-=F')
@ -354,45 +343,45 @@ describe('input non-printable chars', function()
screen:expect([[
foobar |
{1:~ }|*3
{4: }|
{3: }|
"Xtest-overwrite" |
{2:WARNING: The file has been changed since reading it!!!} |
{3:Do you really want to write to it (y/n)?}^ |
{9:WARNING: The file has been changed since reading it!!!} |
{6:Do you really want to write to it (y/n)?}^ |
]])
feed('u')
screen:expect([[
foobar |
{1:~ }|*2
{4: }|
{3: }|
"Xtest-overwrite" |
{2:WARNING: The file has been changed since reading it!!!} |
{3:Do you really want to write to it (y/n)?}u |
{3:Do you really want to write to it (y/n)?}^ |
{9:WARNING: The file has been changed since reading it!!!} |
{6:Do you really want to write to it (y/n)?}u |
{6:Do you really want to write to it (y/n)?}^ |
]])
feed('\005')
screen:expect([[
foobar |
{1:~ }|
{4: }|
{3: }|
"Xtest-overwrite" |
{2:WARNING: The file has been changed since reading it!!!} |
{3:Do you really want to write to it (y/n)?}u |
{3:Do you really want to write to it (y/n)?} |
{3:Do you really want to write to it (y/n)?}^ |
{9:WARNING: The file has been changed since reading it!!!} |
{6:Do you really want to write to it (y/n)?}u |
{6:Do you really want to write to it (y/n)?} |
{6:Do you really want to write to it (y/n)?}^ |
]])
feed('n')
screen:expect([[
foobar |
{4: }|
{3: }|
"Xtest-overwrite" |
{2:WARNING: The file has been changed since reading it!!!} |
{3:Do you really want to write to it (y/n)?}u |
{3:Do you really want to write to it (y/n)?} |
{3:Do you really want to write to it (y/n)?}n |
{3:Press ENTER or type command to continue}^ |
{9:WARNING: The file has been changed since reading it!!!} |
{6:Do you really want to write to it (y/n)?}u |
{6:Do you really want to write to it (y/n)?} |
{6:Do you really want to write to it (y/n)?}n |
{6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@ -437,10 +426,6 @@ describe('display is updated', function()
local screen
before_each(function()
screen = Screen.new(60, 8)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText
[2] = { bold = true }, -- ModeMsg
})
screen:attach()
end)
@ -452,7 +437,7 @@ describe('display is updated', function()
abc |
^ |
{1:~ }|*5
{2:-- INSERT --} |
{5:-- INSERT --} |
]])
end)
@ -464,7 +449,7 @@ describe('display is updated', function()
abc |
^ |
{1:~ }|*5
{2:-- INSERT --} |
{5:-- INSERT --} |
]])
end)
end)

File diff suppressed because it is too large Load Diff

View File

@ -12,20 +12,13 @@ describe('ui mode_change event', function()
clear()
screen = Screen.new(25, 4)
screen:attach({ rgb = true })
screen:set_default_attr_ids({
[0] = { bold = true, foreground = 255 },
[1] = { bold = true, reverse = true },
[2] = { bold = true },
[3] = { reverse = true },
[4] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg
})
end)
it('works in normal mode', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',
@ -35,7 +28,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'operator',
@ -45,7 +38,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',
@ -61,7 +54,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'operator',
@ -71,8 +64,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{4:E21: Cannot make changes, 'modifiable' is off} |
{1:~ }|*2
{9:E21: Cannot make changes, 'modifiable' is off} |
]],
mode = 'normal',
}
@ -84,7 +77,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'replace',
@ -94,7 +87,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',
@ -106,8 +99,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{2:-- INSERT --} |
{1:~ }|*2
{5:-- INSERT --} |
]],
mode = 'insert',
}
@ -116,7 +109,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',
@ -133,8 +126,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff^ |
{0:~ }|*2
{2:-- INSERT --} |
{1:~ }|*2
{5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@ -144,8 +137,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word^(stuff) |
{0:~ }|*2
{2:-- INSERT --} |
{1:~ }|*2
{5:-- INSERT --} |
]],
mode = 'showmatch',
timeout = screen_timeout,
@ -154,8 +147,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff)^ |
{0:~ }|*2
{2:-- INSERT --} |
{1:~ }|*2
{5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@ -168,8 +161,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{2:-- REPLACE --} |
{1:~ }|*2
{5:-- REPLACE --} |
]],
mode = 'replace',
}
@ -178,7 +171,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',
@ -190,7 +183,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
{0:~ }|*2
{1:~ }|*2
:^ |
]],
mode = 'cmdline_normal',
@ -200,7 +193,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
{0:~ }|*2
{1:~ }|*2
:^x |
]],
mode = 'cmdline_insert',
@ -210,7 +203,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
{0:~ }|*2
{1:~ }|*2
:^x |
]],
mode = 'cmdline_replace',
@ -220,7 +213,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
{0:~ }|*2
{1:~ }|*2
:x^ |
]],
mode = 'cmdline_normal',
@ -230,7 +223,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',
@ -243,8 +236,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
{0:~ }|*2
{2:-- VISUAL --} |
{1:~ }|*2
{5:-- VISUAL --} |
]],
mode = 'visual',
}
@ -253,7 +246,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',
@ -264,8 +257,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
{0:~ }|*2
{2:-- VISUAL --} |
{1:~ }|*2
{5:-- VISUAL --} |
]],
mode = 'visual_select',
}
@ -274,7 +267,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
{0:~ }|*2
{1:~ }|*2
|
]],
mode = 'normal',

View File

@ -16,15 +16,6 @@ describe('multibyte rendering', function()
clear()
screen = Screen.new(60, 6)
screen:attach({ rgb = true })
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue },
[2] = { background = Screen.colors.WebGray },
[3] = { background = Screen.colors.LightMagenta },
[4] = { bold = true },
[5] = { foreground = Screen.colors.Blue },
[6] = { reverse = true, bold = true },
[7] = { reverse = true },
})
end)
it('works with composed char at start of line', function()
@ -83,17 +74,17 @@ describe('multibyte rendering', function()
ab ^ |
- |
{1:~ }|*3
{4:-- INSERT --} |
{5:-- INSERT --} |
]])
-- check double-width char is temporarily hidden when overlapped
fn.complete(4, { 'xx', 'yy' })
screen:expect([[
ab xx^ |
- {2: xx } |
{1:~ }{3: yy }{1: }|
- {12: xx } |
{1:~ }{4: yy }{1: }|
{1:~ }|*2
{4:-- INSERT --} |
{5:-- INSERT --} |
]])
-- check it is properly restored
@ -102,7 +93,7 @@ describe('multibyte rendering', function()
ab xxz^ |
- |
{1:~ }|*3
{4:-- INSERT --} |
{5:-- INSERT --} |
]])
end)
@ -129,7 +120,7 @@ describe('multibyte rendering', function()
{1:~ }a口口口口口口口口口口口口口口口口 |
{1:~ }aa口口口口口口口口口口口口口口口口 |
{1:~ }aaa口口口口口口口口口口口口口口口口 |
{6:[No Name] }{7:[No Name] [+] }|
{3:[No Name] }{2:[No Name] [+] }|
|
]])
end)
@ -139,7 +130,7 @@ describe('multibyte rendering', function()
feed('$')
screen:expect {
grid = [[
{5:<ffff>}!!^! |
{18:<ffff>}!!^! |
{1:~ }|*4
|
]],
@ -285,11 +276,6 @@ describe('multibyte rendering: statusline', function()
before_each(function()
clear()
screen = Screen.new(40, 4)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { bold = true, reverse = true },
[3] = { background = Screen.colors.Red, foreground = Screen.colors.Gray100 },
})
screen:attach()
command('set laststatus=2')
end)
@ -299,7 +285,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
{2: }|
{3: }|
|
]])
end)
@ -308,7 +294,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
{2:abc }|
{3:abc }|
|
]])
end)
@ -317,7 +303,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
{2:<9f> }|
{3:<9f> }|
|
]])
end)
@ -327,7 +313,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
{2:o̸⃯ᷰ⃐⃧ }|
{3:o̸⃯ᷰ⃐⃧ }|
|
]])
end)
@ -337,7 +323,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
{2:<9f><1df0><20ef><0338><20d0><20e7><20dd>}|
{3:<9f><1df0><20ef><0338><20d0><20e7><20dd>}|
|
]])
end)
@ -348,7 +334,7 @@ describe('multibyte rendering: statusline', function()
grid = [[
^ |
{1:~ }|
{2: Q }|
{3: Q }|
|
]],
}
@ -361,7 +347,7 @@ describe('multibyte rendering: statusline', function()
grid = [[
^ |
{1:~ }|
{2:🧑<EFBFBD>💻 }|
{3:🧑<EFBFBD>💻 }|
|
]],
}
@ -375,7 +361,7 @@ describe('multibyte rendering: statusline', function()
grid = [[
^ |
{1:~ }|
{2:xx}{3:🧑<200d>💻}{2:yy }|
{3:xx}{9:🧑<200d>💻}{3:yy }|
|
]],
}

View File

@ -27,17 +27,13 @@ describe('screen', function()
set_session(screen_nvim)
screen = Screen.new()
screen:attach()
screen:set_default_attr_ids({
[0] = { bold = true, foreground = 255 },
[1] = { bold = true, reverse = true },
})
end)
it('default initial screen', function()
screen:expect([[
^ |
{0:~ }|*11
{1:[No Name] }|
{1:~ }|*11
{3:[No Name] }|
|
]])
end)
@ -811,9 +807,6 @@ end)
it("showcmd doesn't cause empty grid_line with redrawdebug=compositor #22593", function()
clear()
local screen = Screen.new(30, 2)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
})
screen:attach()
command('set showcmd redrawdebug=compositor')
feed('d')

View File

@ -140,58 +140,54 @@ describe('statuscolumn', function()
.. [[%=%{&rnu&&(v:lnum%2)?'\ '.v:relnum:''}]]
.. [[%#LineNr#%{&rnu&&!(v:lnum%2)?'\ '.v:relnum:''}│]]
)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
[1] = { foreground = Screen.colors.Brown },
})
screen:expect([[
{0:4 }{1:}aaaaa |
{0:5 }{1:}aaaaa |
{0:6 }{1:}aaaaa |
{0:7 }{1:}aaaaa |
{0:8 }{1:}^aaaaa |
{0:9 }{1:}aaaaa |
{0:10}{1:}aaaaa |
{0:11}{1:}aaaaa |
{0:12}{1:}aaaaa |
{0:13}{1:}aaaaa |
{0:14}{1:}aaaaa |
{0:15}{1:}aaaaa |
{0:16}{1:}aaaaa |
{1:4 }{8:}aaaaa |
{1:5 }{8:}aaaaa |
{1:6 }{8:}aaaaa |
{1:7 }{8:}aaaaa |
{1:8 }{8:}^aaaaa |
{1:9 }{8:}aaaaa |
{1:10}{8:}aaaaa |
{1:11}{8:}aaaaa |
{1:12}{8:}aaaaa |
{1:13}{8:}aaaaa |
{1:14}{8:}aaaaa |
{1:15}{8:}aaaaa |
{1:16}{8:}aaaaa |
|
]])
command('set relativenumber')
screen:expect([[
{0:4 }{1: 4}aaaaa |
{0:5 3}{1:}aaaaa |
{0:6 }{1: 2}aaaaa |
{0:7 1}{1:}aaaaa |
{0:8 }{1: 0}^aaaaa |
{0:9 1}{1:}aaaaa |
{0:10}{1: 2}aaaaa |
{0:11 3}{1:}aaaaa |
{0:12}{1: 4}aaaaa |
{0:13 5}{1:}aaaaa |
{0:14}{1: 6}aaaaa |
{0:15 7}{1:}aaaaa |
{0:16}{1: 8}aaaaa |
{1:4 }{8: 4}aaaaa |
{1:5 3}{8:}aaaaa |
{1:6 }{8: 2}aaaaa |
{1:7 1}{8:}aaaaa |
{1:8 }{8: 0}^aaaaa |
{1:9 1}{8:}aaaaa |
{1:10}{8: 2}aaaaa |
{1:11 3}{8:}aaaaa |
{1:12}{8: 4}aaaaa |
{1:13 5}{8:}aaaaa |
{1:14}{8: 6}aaaaa |
{1:15 7}{8:}aaaaa |
{1:16}{8: 8}aaaaa |
|
]])
command('set nonumber')
screen:expect([[
{1:4}aaaaa |
{0:3}{1:}aaaaa |
{1:2}aaaaa |
{0:1}{1:}aaaaa |
{1:0}^aaaaa |
{0:1}{1:}aaaaa |
{1:2}aaaaa |
{0:3}{1:}aaaaa |
{1:4}aaaaa |
{0:5}{1:}aaaaa |
{1:6}aaaaa |
{0:7}{1:}aaaaa |
{1:8}aaaaa |
{8:4}aaaaa |
{1:3}{8:}aaaaa |
{8:2}aaaaa |
{1:1}{8:}aaaaa |
{8:0}^aaaaa |
{1:1}{8:}aaaaa |
{8:2}aaaaa |
{1:3}{8:}aaaaa |
{8:4}aaaaa |
{1:5}{8:}aaaaa |
{8:6}aaaaa |
{1:7}{8:}aaaaa |
{8:8}aaaaa |
|
]])
end)
@ -532,15 +528,11 @@ describe('statuscolumn', function()
it('does not corrupt the screen with minwid sign item', function()
screen:try_resize(screen._width, 3)
screen:set_default_attr_ids({
[0] = { foreground = Screen.colors.Brown },
[1] = { foreground = Screen.colors.Blue4, background = Screen.colors.Gray },
})
command([[set stc=%6s\ %l]])
exec_lua('vim.api.nvim_buf_set_extmark(0, ns, 7, 0, {sign_text = "𒀀"})')
screen:expect([[
{0: 𒀀 8 }^aaaaa |
{0: }{1: }{0: 9 }aaaaa |
{8: 𒀀 8 }^aaaaa |
{8: }{7: }{8: 9 }aaaaa |
|
]])
end)

View File

@ -99,10 +99,6 @@ 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()
@ -110,18 +106,18 @@ describe('tabline', function()
command('set showtabline=2')
screen:expect {
grid = [[
{1:asdf }|
{2:asdf }|
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
}
command('set tabline=jkl')
screen:expect {
grid = [[
{1:jkl }|
{2:jkl }|
^ |
{0:~ }|*2
{1:~ }|*2
|
]],
}
@ -141,9 +137,9 @@ describe('tabline', function()
api.nvim_set_option_value('tabline', '%1T口口%2Ta' .. ('b'):rep(38) .. '%999Xc', {})
screen:expect {
grid = [[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
{2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^1 |
{0:~ }|*2
{1:~ }|*2
|
]],
}
@ -151,27 +147,27 @@ describe('tabline', function()
api.nvim_input_mouse('left', 'press', '', 0, 0, 1)
screen:expect {
grid = [[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
{2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^2 |
{0:~ }|*2
{1:~ }|*2
|
]],
}
api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
screen:expect {
grid = [[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
{2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^1 |
{0:~ }|*2
{1:~ }|*2
|
]],
}
api.nvim_input_mouse('left', 'press', '', 0, 0, 39)
screen:expect {
grid = [[
{1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
{2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^2 |
{0:~ }|*2
{1:~ }|*2
|
]],
}
@ -179,7 +175,7 @@ describe('tabline', function()
screen:expect {
grid = [[
tab^1 |
{0:~ }|*3
{1:~ }|*3
|
]],
}

View File

@ -525,30 +525,24 @@ describe('local winbar with tabs', function()
clear()
screen = Screen.new(60, 10)
screen:attach()
screen:set_default_attr_ids({
[1] = { bold = true },
[2] = { reverse = true },
[3] = { bold = true, foreground = Screen.colors.Blue },
[4] = { underline = true, background = Screen.colors.LightGray },
})
api.nvim_set_option_value('winbar', 'foo', { scope = 'local', win = 0 })
end)
it('works', function()
command('tabnew')
screen:expect([[
{4: [No Name] }{1: [No Name] }{2: }{4:X}|
{24: [No Name] }{5: [No Name] }{2: }{24:X}|
^ |
{3:~ }|*7
{1:~ }|*7
|
]])
command('tabnext')
screen:expect {
grid = [[
{1: [No Name] }{4: [No Name] }{2: }{4:X}|
{1:foo }|
{5: [No Name] }{24: [No Name] }{2: }{24:X}|
{5:foo }|
^ |
{3:~ }|*6
{1:~ }|*6
|
]],
}
@ -561,11 +555,11 @@ describe('local winbar with tabs', function()
text]]
screen:expect {
grid = [[
{1:foo }|
{5:foo }|
some |
goofy |
tex^t |
{3:~ }|*5
{1:~ }|*5
|
]],
}
@ -574,9 +568,9 @@ describe('local winbar with tabs', function()
command 'tabedit'
screen:expect {
grid = [[
{4: + [No Name] }{1: [No Name] }{2: }{4:X}|
{24: + [No Name] }{5: [No Name] }{2: }{24:X}|
^ |
{3:~ }|*7
{1:~ }|*7
|
]],
}
@ -584,12 +578,12 @@ describe('local winbar with tabs', function()
command 'tabprev'
screen:expect {
grid = [[
{1: + [No Name] }{4: [No Name] }{2: }{4:X}|
{1:foo }|
{5: + [No Name] }{24: [No Name] }{2: }{24:X}|
{5:foo }|
some |
goofy |
tex^t |
{3:~ }|*4
{1:~ }|*4
|
]],
}
@ -609,16 +603,11 @@ it('winbar works properly when redrawing is postponed #23534', function()
})
local screen = Screen.new(60, 6)
screen:attach()
screen:set_default_attr_ids({
[0] = { foreground = Screen.colors.Blue, bold = true },
[1] = { bold = true },
[2] = { bold = true, reverse = true },
})
screen:expect([[
{1:(winbar) }|
{5:(winbar) }|
^ |
{0:~ }|*2
{2:(statusline) }|
{1:~ }|*2
{3:(statusline) }|
|
]])
end)