aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/ui/highlight_spec.lua929
-rw-r--r--test/functional/ui/messages_spec.lua421
2 files changed, 586 insertions, 764 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 34a7bc19c6..57d0f2f590 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -32,11 +32,6 @@ describe('highlight: `:syntax manual`', function()
screen = Screen.new(20, 5)
screen:attach()
-- syntax highlight for vimscript's "echo"
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { bold = true, foreground = Screen.colors.Brown },
- [2] = { foreground = Screen.colors.Magenta1 },
- })
end)
after_each(function()
@@ -57,8 +52,8 @@ describe('highlight: `:syntax manual`', function()
command('bn')
feed_command('bp')
screen:expect([[
- {1:^echo} {2:1} |
- {0:~ }|*3
+ {15:^echo} {26:1} |
+ {1:~ }|*3
:bp |
]])
end)
@@ -79,8 +74,8 @@ describe('highlight: `:syntax manual`', function()
feed_command('silent bp')
eq('Xtest-functional-ui-highlight.tmp.vim', eval("fnamemodify(bufname('%'), ':t')"))
screen:expect([[
- {1:^echo} {2:1} |
- {0:~ }|*3
+ {15:^echo} {26:1} |
+ {1:~ }|*3
:silent bp |
]])
end)
@@ -92,17 +87,9 @@ describe('highlight defaults', function()
before_each(function()
clear()
screen = Screen.new()
- screen:set_default_attr_ids {
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { reverse = true, bold = true },
- [2] = { reverse = true },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen },
- [5] = { foreground = Screen.colors.Red1, background = Screen.colors.WebGreen },
- [6] = { background = Screen.colors.Red1, foreground = Screen.colors.Grey100 },
- [7] = { foreground = Screen.colors.Red },
- [8] = { foreground = Screen.colors.Blue },
- [9] = { italic = true },
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Red, background = Screen.colors.WebGreen },
+ [101] = { italic = true },
}
screen:attach()
end)
@@ -111,10 +98,10 @@ describe('highlight defaults', function()
feed_command('sp', 'vsp', 'vsp')
screen:expect([[
^ │ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {1:[No Name] }{2:[No Name] [No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {3:[No Name] }{2:[No Name] [No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
@@ -122,11 +109,11 @@ describe('highlight defaults', function()
feed('<c-w>j')
screen:expect([[
│ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
+ {1:~ }│{1:~ }│{1:~ }|*5
{2:[No Name] [No Name] [No Name] }|
^ |
- {0:~ }|*4
- {1:[No Name] }|
+ {1:~ }|*4
+ {3:[No Name] }|
:vsp |
]])
-- note that when moving to a window with small width nvim will increase
@@ -135,30 +122,30 @@ describe('highlight defaults', function()
feed('<c-w>k<c-w>l')
screen:expect([[
│^ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {2:[No Name] }{1:[No Name] }{2:[No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {2:[No Name] }{3:[No Name] }{2:[No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
feed('<c-w>l')
screen:expect([[
│ │^ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {2:[No Name] [No Name] }{1:[No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {2:[No Name] [No Name] }{3:[No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
feed('<c-w>h<c-w>h')
screen:expect([[
^ │ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {1:[No Name] }{2:[No Name] [No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {3:[No Name] }{2:[No Name] [No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
@@ -169,8 +156,8 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|*2
- {3:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
end)
@@ -178,7 +165,7 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
@@ -187,10 +174,10 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
feed(':ls<cr>')
screen:expect([[
- {1: }|
+ {3: }|
:ls |
1 %a "[No Name]" line 1 |
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>') -- skip the "Press ENTER..." state or tests will hang
end)
@@ -201,7 +188,7 @@ describe('highlight defaults', function()
feed('i')
screen:expect([[
^ |
- {0:~ }|*2
+ {1:~ }|*2
-- INSERT -- |
]])
feed('<esc>')
@@ -210,8 +197,8 @@ describe('highlight defaults', function()
feed('i')
screen:expect([[
^ |
- {0:~ }|*2
- {5:-- INSERT --} |
+ {1:~ }|*2
+ {100:-- INSERT --} |
]])
end)
@@ -221,8 +208,8 @@ describe('highlight defaults', function()
feed_command('hi link TmpKeyword ErrorMsg')
insert('neovim')
screen:expect([[
- {6:neovi^m} |
- {0:~ }|*2
+ {9:neovi^m} |
+ {1:~ }|*2
|
]])
feed_command(
@@ -231,7 +218,7 @@ describe('highlight defaults', function()
)
screen:expect([[
neovi^m |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
@@ -240,19 +227,16 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed_command('hi NonTextAlt guifg=Red')
feed_command('hi! link NonText NonTextAlt')
- screen:expect(
- [[
+ screen:expect([[
^ |
- {0:~ }|*2
+ {19:~ }|*2
:hi! link NonText NonTextAlt |
- ]],
- { [0] = { foreground = Screen.colors.Red } }
- )
+ ]])
end)
it('Cursor after `:hi clear|syntax reset` #6508', function()
@@ -266,47 +250,48 @@ describe('highlight defaults', function()
feed_command('set listchars=space:.,tab:>-,trail:*,eol:¬ list')
insert(' ne \t o\tv im ')
screen:expect([[
- ne{7:.>----.}o{7:>-----}v{7:..}im{7:*^*¬} |
- {7:~ }|*2
+ ne{19:.>----.}o{19:>-----}v{19:..}im{19:*^*¬} |
+ {19:~ }|*2
|
]])
feed_command('highlight Whitespace gui=NONE guifg=#0000FF')
screen:expect([[
- ne{8:.>----.}o{8:>-----}v{8:..}im{8:*^*}{7:¬} |
- {7:~ }|*2
+ ne{18:.>----.}o{18:>-----}v{18:..}im{18:*^*}{19:¬} |
+ {19:~ }|*2
:highlight Whitespace gui=NONE guifg=#0000FF |
]])
end)
it('are sent to UIs', function()
screen:try_resize(53, 4)
+
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
- hl_groups = { EndOfBuffer = 0, MsgSeparator = 1 },
+ hl_groups = { EndOfBuffer = 1, MsgSeparator = 3 },
}
command('highlight EndOfBuffer gui=italic')
screen:expect {
grid = [[
^ |
- {9:~ }|*2
+ {101:~ }|*2
|
]],
- hl_groups = { EndOfBuffer = 9, MsgSeparator = 1 },
+ hl_groups = { EndOfBuffer = 101, MsgSeparator = 3 },
}
command('highlight clear EndOfBuffer')
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
- hl_groups = { EndOfBuffer = 0, MsgSeparator = 1 },
+ hl_groups = { EndOfBuffer = 1, MsgSeparator = 3 },
}
end)
end)
@@ -317,14 +302,6 @@ describe('highlight', function()
it('Visual', function()
local screen = Screen.new(45, 5)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
- [2] = { bold = true, foreground = Screen.colors.Blue },
- [3] = { bold = true },
- [4] = { reverse = true, bold = true },
- [5] = { reverse = true },
- [6] = { background = Screen.colors.Grey90 },
- })
insert([[
line1 foo bar
abcdefghijklmnopqrs
@@ -337,137 +314,136 @@ describe('highlight', function()
command('set guicursor=a:block-blinkon0')
feed('V')
screen:expect([[
- {1: }^l{1:ine1 foo bar} │{1: line1 foo bar} |
+ {17: }^l{17:ine1 foo bar} │{17: line1 foo bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL LINE --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL LINE --} |
]])
feed('<Esc>$vhhh')
screen:expect([[
- line1 foo^ {1:bar} │ line1 foo{1: bar} |
+ line1 foo^ {17:bar} │ line1 foo{17: bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
-- Vertical cursor: highlights char-at-cursor. #8983
command('set guicursor=a:block-blinkon175')
screen:expect([[
- line1 foo{1:^ bar} │ line1 foo{1: bar} |
+ line1 foo{17:^ bar} │ line1 foo{17: bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
command('set selection=exclusive')
screen:expect([[
- line1 foo{1:^ ba}r │ line1 foo{1: ba}r |
+ line1 foo{17:^ ba}r │ line1 foo{17: ba}r |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
feed('o')
screen:expect([[
- line1 foo{1: ba}^r │ line1 foo{1: ba}r |
+ line1 foo{17: ba}^r │ line1 foo{17: ba}r |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
feed('V')
screen:expect([[
- {1: line1 foo ba^r} │{1: line1 foo bar} |
+ {17: line1 foo ba^r} │{17: line1 foo bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL LINE --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL LINE --} |
]])
command('set cursorcolumn')
feed('<C-V>')
screen:expect([[
- line1 foo{1: ba}^r │ line1 foo{1: ba}r |
- abcdefghijklmn{6:o}pqrs │abcdefghijklmnopqrs |
- ABCDEFGHIJKLMN{6:O}PQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ line1 foo{17: ba}^r │ line1 foo{17: ba}r |
+ abcdefghijklmn{21:o}pqrs │abcdefghijklmnopqrs |
+ ABCDEFGHIJKLMN{21:O}PQRS │ABCDEFGHIJKLMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
command('set selection&')
screen:expect([[
- line1 foo{1: ba^r} │ line1 foo{1: bar} |
- abcdefghijklmn{6:o}pqrs │abcdefghijklmnopqrs |
- ABCDEFGHIJKLMN{6:O}PQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ line1 foo{17: ba^r} │ line1 foo{17: bar} |
+ abcdefghijklmn{21:o}pqrs │abcdefghijklmnopqrs |
+ ABCDEFGHIJKLMN{21:O}PQRS │ABCDEFGHIJKLMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('^')
screen:expect([[
- {1:^line1 foo }bar │ {1:line1 foo }bar |
- ab{6:c}defghijklmnopqrs │abcdefghijklmnopqrs |
- AB{6:C}DEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:^line1 foo }bar │ {17:line1 foo }bar |
+ ab{21:c}defghijklmnopqrs │abcdefghijklmnopqrs |
+ AB{21:C}DEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('2j')
screen:expect([[
- {1:line1 foo }bar │ {1:line1 foo }bar |
- ab{1:cdefghijkl}mnopqrs │ab{1:cdefghijkl}mnopqrs |
- AB{1:^CDEFGHIJKL}MNOPQRS │AB{1:CDEFGHIJKL}MNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:line1 foo }bar │ {17:line1 foo }bar |
+ ab{17:cdefghijkl}mnopqrs │ab{17:cdefghijkl}mnopqrs |
+ AB{17:^CDEFGHIJKL}MNOPQRS │AB{17:CDEFGHIJKL}MNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
command('set nocursorcolumn')
feed('O')
screen:expect([[
- {1:line1 foo }bar │ {1:line1 foo }bar |
- ab{1:cdefghijkl}mnopqrs │ab{1:cdefghijkl}mnopqrs |
- AB{1:CDEFGHIJK^L}MNOPQRS │AB{1:CDEFGHIJKL}MNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:line1 foo }bar │ {17:line1 foo }bar |
+ ab{17:cdefghijkl}mnopqrs │ab{17:cdefghijkl}mnopqrs |
+ AB{17:CDEFGHIJK^L}MNOPQRS │AB{17:CDEFGHIJKL}MNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
command('set selection=exclusive')
screen:expect([[
- {1:line1 foo} bar │ {1:line1 foo} bar |
- ab{1:cdefghijk}lmnopqrs │ab{1:cdefghijk}lmnopqrs |
- AB{1:CDEFGHIJK}^LMNOPQRS │AB{1:CDEFGHIJK}LMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:line1 foo} bar │ {17:line1 foo} bar |
+ ab{17:cdefghijk}lmnopqrs │ab{17:cdefghijk}lmnopqrs |
+ AB{17:CDEFGHIJK}^LMNOPQRS │AB{17:CDEFGHIJK}LMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
end)
it('cterm=standout gui=standout', function()
local screen = Screen.new(20, 5)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = {
- standout = true,
+ screen:add_extra_attr_ids {
+ [100] = {
+ foreground = Screen.colors.Blue1,
bold = true,
+ background = Screen.colors.Grey90,
underline = true,
- background = Screen.colors.Gray90,
- foreground = Screen.colors.Blue1,
+ standout = true,
},
- [3] = { standout = true, underline = true, background = Screen.colors.Gray90 },
- })
+ [101] = { underline = true, standout = true, background = Screen.colors.Grey90 },
+ }
feed_command('hi CursorLine cterm=standout,underline gui=standout,underline')
feed_command('set cursorline')
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
feed('i\t abcd <cr>\t abcd <cr><esc>k')
screen:expect([[
{1:>-------.}abcd{1:*¬} |
- {2:^>-------.}{3:abcd}{2:*¬}{3: }|
+ {100:^>-------.}{101:abcd}{100:*¬}{101: }|
{1:¬} |
{1:~ }|
|
@@ -504,16 +480,13 @@ describe('highlight', function()
it('nocombine', function()
local screen = Screen.new(25, 6)
- screen:set_default_attr_ids {
- [1] = { foreground = Screen.colors.SlateBlue, underline = true },
- [2] = { bold = true, foreground = Screen.colors.Blue1 },
- [3] = { underline = true, reverse = true, foreground = Screen.colors.SlateBlue },
- [4] = {
- background = Screen.colors.Yellow,
- reverse = true,
+ screen:add_extra_attr_ids {
+ [100] = { underline = true, reverse = true, foreground = Screen.colors.SlateBlue },
+ [101] = {
foreground = Screen.colors.SlateBlue,
+ reverse = true,
+ background = Screen.colors.Yellow,
},
- [5] = { foreground = Screen.colors.Red },
}
screen:attach()
feed_command('syntax on')
@@ -526,9 +499,9 @@ describe('highlight', function()
]])
screen:expect {
grid = [[
- {1:foobar} |*2
+ {28:foobar} |*2
^ |
- {2:~ }|*2
+ {1:~ }|*2
|
]],
}
@@ -536,21 +509,21 @@ describe('highlight', function()
feed('/foo')
screen:expect {
grid = [[
- {3:foo}{1:bar} |
- {4:foo}{1:bar} |
+ {100:foo}{28:bar} |
+ {101:foo}{28:bar} |
|
- {2:~ }|*2
+ {1:~ }|*2
/foo^ |
]],
}
feed('<cr>')
screen:expect {
grid = [[
- {4:^foo}{1:bar} |
- {4:foo}{1:bar} |
+ {101:^foo}{28:bar} |
+ {101:foo}{28:bar} |
|
- {2:~ }|*2
- {5:search hit...uing at TOP} |
+ {1:~ }|*2
+ {19:search hit...uing at TOP} |
]],
}
end)
@@ -660,44 +633,40 @@ describe("'listchars' highlight", function()
end)
it("'cursorline' and 'cursorcolumn'", function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { background = Screen.colors.Grey90 },
- })
feed_command('highlight clear ModeMsg')
feed_command('set cursorline')
feed('i')
screen:expect([[
- {1:^ }|
- {0:~ }|*3
+ {21:^ }|
+ {1:~ }|*3
-- INSERT -- |
]])
feed('abcdefg<cr>kkasdf')
screen:expect([[
abcdefg |
- {1:kkasdf^ }|
- {0:~ }|*2
+ {21:kkasdf^ }|
+ {1:~ }|*2
-- INSERT -- |
]])
feed('<esc>')
screen:expect([[
abcdefg |
- {1:kkasd^f }|
- {0:~ }|*2
+ {21:kkasd^f }|
+ {1:~ }|*2
|
]])
feed_command('set nocursorline')
screen:expect([[
abcdefg |
kkasd^f |
- {0:~ }|*2
+ {1:~ }|*2
:set nocursorline |
]])
feed('k')
screen:expect([[
abcde^fg |
kkasdf |
- {0:~ }|*2
+ {1:~ }|*2
:set nocursorline |
]])
feed('jjji<cr><cr><cr><esc>')
@@ -711,42 +680,27 @@ describe("'listchars' highlight", function()
feed_command('set cursorcolumn')
feed('kkiabcdefghijk<esc>hh')
screen:expect([[
- kkasd {1: } |
- {1:abcdefgh^ijk }|
- {1: } |
- f {1: } |
+ kkasd {21: } |
+ {21:abcdefgh^ijk }|
+ {21: } |
+ f {21: } |
|
]])
feed('khh')
screen:expect([[
- {1:kk^asd }|
- ab{1:c}defghijk |
- {1: } |
- f {1: } |
+ {21:kk^asd }|
+ ab{21:c}defghijk |
+ {21: } |
+ f {21: } |
|
]])
end)
it("'cursorline' and with 'listchars' option", function()
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Grey90 },
- [2] = {
- foreground = Screen.colors.Red,
- background = Screen.colors.Grey90,
- },
- [3] = {
- background = Screen.colors.Grey90,
- foreground = Screen.colors.Blue,
- bold = true,
- },
- [4] = {
- foreground = Screen.colors.Blue,
- bold = true,
- },
- [5] = {
- foreground = Screen.colors.Red,
- },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
+ [101] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.Grey90 },
+ }
feed_command('highlight clear ModeMsg')
feed_command('highlight Whitespace guifg=#FF0000')
feed_command('set cursorline')
@@ -754,73 +708,70 @@ describe("'listchars' highlight", function()
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
feed('i\t abcd <cr>\t abcd <cr><esc>k')
screen:expect([[
- {5:>-------.}abcd{5:*}{4:¬} |
- {2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
- {4:¬} |
- {4:~ }|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {100:^>-------.}{21:abcd}{100:*}{101:¬}{21: }|
+ {1:¬} |
+ {1:~ }|
|
]])
feed('k')
screen:expect([[
- {2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {100:^>-------.}{21:abcd}{100:*}{101:¬}{21: }|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
|
]])
feed_command('set nocursorline')
screen:expect([[
- {5:^>-------.}abcd{5:*}{4:¬} |
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {19:^>-------.}abcd{19:*}{1:¬} |
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
:set nocursorline |
]])
feed_command('set nowrap')
feed('ALorem ipsum dolor sit amet<ESC>0')
screen:expect([[
- {5:^>-------.}abcd{5:.}Lorem{4:>}|
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {19:^>-------.}abcd{19:.}Lorem{1:>}|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
|
]])
feed_command('set cursorline')
screen:expect([[
- {2:^>-------.}{1:abcd}{2:.}{1:Lorem}{3:>}|
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {100:^>-------.}{21:abcd}{100:.}{21:Lorem}{101:>}|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
:set cursorline |
]])
feed('$')
screen:expect([[
- {3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
- {4:<} |*2
- {4:~ }|
+ {101:<}{21:r}{100:.}{21:sit}{100:.}{21:ame^t}{101:¬}{21: }|
+ {1:<} |*2
+ {1:~ }|
:set cursorline |
]])
feed('G')
screen:expect([[
- {5:>-------.}abcd{5:.}Lorem{4:>}|
- {5:>-------.}abcd{5:*}{4:¬} |
- {3:^¬}{1: }|
- {4:~ }|
+ {19:>-------.}abcd{19:.}Lorem{1:>}|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {101:^¬}{21: }|
+ {1:~ }|
:set cursorline |
]])
end)
it("'listchar' with wrap", function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- })
feed_command('set wrap')
feed_command('set listchars=eol:¬,precedes:< list')
feed('90ia<esc>')
screen:expect([[
- {0:<}aaaaaaaaaaaaaaaaaaa|
+ {1:<}aaaaaaaaaaaaaaaaaaa|
aaaaaaaaaaaaaaaaaaaa|*2
- aaaaaaaaa^a{0:¬} |
+ aaaaaaaaa^a{1:¬} |
|
]])
feed('0')
@@ -832,16 +783,16 @@ describe("'listchars' highlight", function()
end)
it("'listchar' in visual mode", function()
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Grey90 },
- [2] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
- [3] = { background = Screen.colors.Grey90, foreground = Screen.colors.Blue, bold = true },
- [4] = { foreground = Screen.colors.Blue, bold = true },
- [5] = { foreground = Screen.colors.Red },
- [6] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
- [7] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Red },
- [8] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Blue, bold = true },
- })
+ screen:add_extra_attr_ids {
+ [100] = {
+ foreground = Screen.colors.Blue1,
+ bold = true,
+ background = Screen.colors.LightGray,
+ },
+ [101] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
+ [102] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.Grey90 },
+ [103] = { foreground = Screen.colors.Red, background = Screen.colors.LightGray },
+ }
command('highlight clear ModeMsg')
command('highlight Whitespace guifg=#FF0000')
command('set cursorline')
@@ -850,45 +801,42 @@ describe("'listchars' highlight", function()
command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
feed('i\t abcd <cr>\t abcd Lorem ipsum dolor sit amet<cr><esc>kkk0')
screen:expect([[
- {2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
- {5:>-------.}abcd{5:.}Lorem{4:>}|
- {4:¬} |
- {4:~ }|
+ {101:^>-------.}{21:abcd}{101:*}{102:¬}{21: }|
+ {19:>-------.}abcd{19:.}Lorem{1:>}|
+ {1:¬} |
+ {1:~ }|
|
]])
feed('lllvj')
screen:expect([[
- {5:>-------.}a{6:bcd}{7:*}{8:¬} |
- {7:>-------.}{6:a}^bcd{5:.}Lorem{4:>}|
- {4:¬} |
- {4:~ }|
+ {19:>-------.}a{17:bcd}{103:*}{100:¬} |
+ {103:>-------.}{17:a}^bcd{19:.}Lorem{1:>}|
+ {1:¬} |
+ {1:~ }|
-- VISUAL -- |
]])
feed('<esc>V')
screen:expect([[
- {5:>-------.}abcd{5:*}{4:¬} |
- {7:>-------.}{6:a}^b{6:cd}{7:.}{6:Lorem}{4:>}|
- {4:¬} |
- {4:~ }|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {103:>-------.}{17:a}^b{17:cd}{103:.}{17:Lorem}{1:>}|
+ {1:¬} |
+ {1:~ }|
-- VISUAL LINE -- |
]])
feed('<esc>$')
screen:expect([[
- {4:<} |
- {3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
- {4:<} |
- {4:~ }|
+ {1:<} |
+ {102:<}{21:r}{101:.}{21:sit}{101:.}{21:ame^t}{102:¬}{21: }|
+ {1:<} |
+ {1:~ }|
|
]])
end)
it("'cursorline' with :match", function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { background = Screen.colors.Grey90 },
- [2] = { foreground = Screen.colors.Red },
- [3] = { foreground = Screen.colors.X11Green, background = Screen.colors.Red1 },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Lime, background = Screen.colors.Red },
+ }
feed_command('highlight clear ModeMsg')
feed_command('highlight Whitespace guifg=#FF0000')
feed_command('highlight Error guifg=#00FF00')
@@ -896,19 +844,19 @@ describe("'listchars' highlight", function()
feed('ia \t bc \t <esc>')
screen:expect([[
a bc ^ |
- {0:~ }|*3
+ {1:~ }|*3
|
]])
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
screen:expect([[
- a{2:.>-----.}bc{2:*>---*^*}{0:¬} |
- {0:~ }|*3
+ a{19:.>-----.}bc{19:*>---*^*}{1:¬} |
+ {1:~ }|*3
|
]])
feed_command('match Error /\\s\\+$/')
screen:expect([[
- a{2:.>-----.}bc{3:*>---*^*}{0:¬} |
- {0:~ }|*3
+ a{19:.>-----.}bc{100:*>---*^*}{1:¬} |
+ {1:~ }|*3
|
]])
end)
@@ -919,15 +867,10 @@ describe('CursorLine and CursorLineNr highlights', function()
it('overridden by Error, ColorColumn if fg not set', function()
local screen = Screen.new(50, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.SlateBlue },
- [2] = { bold = true, foreground = Screen.colors.Brown },
- [3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [4] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Gray90 },
- [5] = { background = Screen.colors.Gray90 },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.LightRed },
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.LightRed },
+ [101] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Grey90 },
+ }
screen:attach()
command('filetype on')
@@ -935,32 +878,32 @@ describe('CursorLine and CursorLineNr highlights', function()
command('set cursorline ft=json')
feed('i{<cr>"a" : abc // 10;<cr>}<cr><esc>')
screen:expect([[
- {1:{} |
- "{2:a}" : {3:abc} {3:// 10;} |
- {1:}} |
- {5:^ }|
+ {16:{} |
+ "{15:a}" : {9:abc} {9:// 10;} |
+ {16:}} |
+ {21:^ }|
|
]])
command('set colorcolumn=3')
feed('i <esc>')
screen:expect([[
- {1:{} {7: } |
- "{2:a}{7:"} : {3:abc} {3:// 10;} |
- {1:}} {7: } |
- {5: ^ }{7: }{5: }|
+ {16:{} {100: } |
+ "{15:a}{100:"} : {9:abc} {9:// 10;} |
+ {16:}} {100: } |
+ {21: ^ }{100: }{21: }|
|
]])
end)
it("overridden by NonText in 'showbreak' characters", function()
local screen = Screen.new(20, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Yellow, background = Screen.colors.Blue },
- [2] = { foreground = Screen.colors.Black, background = Screen.colors.White },
- [3] = { foreground = Screen.colors.Yellow, background = Screen.colors.White },
- [4] = { foreground = Screen.colors.Yellow },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Yellow1 },
+ [101] = { foreground = Screen.colors.Yellow1, background = Screen.colors.Blue },
+ [102] = { foreground = Screen.colors.Grey0, background = Screen.colors.Grey100 },
+ [103] = { foreground = Screen.colors.Yellow1, background = Screen.colors.Grey100 },
+ }
screen:attach()
feed_command('set wrap cursorline')
@@ -973,46 +916,45 @@ describe('CursorLine and CursorLineNr highlights', function()
feed('30iø<esc>o<esc>30ia<esc>')
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {1:>>>}øøøøøøøøøø |
- {2:aaaaaaaaaaaaaaaaaaaa}|
- {1:>>>}{2:aaaaaaaaa^a }|
+ {101:>>>}øøøøøøøøøø |
+ {102:aaaaaaaaaaaaaaaaaaaa}|
+ {101:>>>}{102:aaaaaaaaa^a }|
|
]])
feed('k')
screen:expect([[
- {2:øøøøøøøøøøøøøøøøøøøø}|
- {1:>>>}{2:øøøøøøøøø^ø }|
+ {102:øøøøøøøøøøøøøøøøøøøø}|
+ {101:>>>}{102:øøøøøøøøø^ø }|
aaaaaaaaaaaaaaaaaaaa|
- {1:>>>}aaaaaaaaaa |
+ {101:>>>}aaaaaaaaaa |
|
]])
feed_command('highlight NonText guibg=NONE')
screen:expect([[
- {2:øøøøøøøøøøøøøøøøøøøø}|
- {3:>>>}{2:øøøøøøøøø^ø }|
+ {102:øøøøøøøøøøøøøøøøøøøø}|
+ {103:>>>}{102:øøøøøøøøø^ø }|
aaaaaaaaaaaaaaaaaaaa|
- {4:>>>}aaaaaaaaaa |
+ {100:>>>}aaaaaaaaaa |
|
]])
feed_command('set nocursorline')
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {4:>>>}øøøøøøøøø^ø |
+ {100:>>>}øøøøøøøøø^ø |
aaaaaaaaaaaaaaaaaaaa|
- {4:>>>}aaaaaaaaaa |
+ {100:>>>}aaaaaaaaaa |
:set nocursorline |
]])
end)
it("'cursorlineopt' screenline", function()
local screen = Screen.new(20, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Black, background = Screen.colors.White },
- [2] = { foreground = Screen.colors.Yellow },
- [3] = { foreground = Screen.colors.Red, background = Screen.colors.Green },
- [4] = { foreground = Screen.colors.Green, background = Screen.colors.Red },
- [5] = { bold = true }, -- ModeMsg
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Yellow },
+ [101] = { foreground = Screen.colors.Red, background = Screen.colors.WebGreen },
+ [102] = { foreground = Screen.colors.Black, background = Screen.colors.Grey100 },
+ [103] = { foreground = Screen.colors.WebGreen, background = Screen.colors.Red },
+ }
screen:attach()
command('set wrap cursorline cursorlineopt=screenline')
@@ -1029,107 +971,107 @@ describe('CursorLine and CursorLineNr highlights', function()
-- CursorLine should not apply to 'showbreak' when 'cursorlineopt' contains "screenline"
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {2:>>>}øøøøøøøøøø |
+ {100:>>>}øøøøøøøøøø |
aaaaaaaaaaaaaaaaaaaa|
- {2:>>>}{1:aaaaaaaaa^a }|
+ {100:>>>}{102:aaaaaaaaa^a }|
|
]])
feed('gk')
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {2:>>>}øøøøøøøøøø |
- {1:aaaaaaaaaaaa^aaaaaaaa}|
- {2:>>>}aaaaaaaaaa |
+ {100:>>>}øøøøøøøøøø |
+ {102:aaaaaaaaaaaa^aaaaaaaa}|
+ {100:>>>}aaaaaaaaaa |
|
]])
feed('k')
screen:expect([[
- {1:øøøøøøøøøøøø^øøøøøøøø}|
- {2:>>>}øøøøøøøøøø |
+ {102:øøøøøøøøøøøø^øøøøøøøø}|
+ {100:>>>}øøøøøøøøøø |
aaaaaaaaaaaaaaaaaaaa|
- {2:>>>}aaaaaaaaaa |
+ {100:>>>}aaaaaaaaaa |
|
]])
-- CursorLineNr should not apply to line number when 'cursorlineopt' does not contain "number"
command('set relativenumber numberwidth=2')
screen:expect([[
- {3:0 }{1:øøøøøøøøøøøø^øøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {101:0 }{102:øøøøøøøøøøøø^øøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
-- CursorLineNr should apply to line number when 'cursorlineopt' contains "number"
command('set cursorlineopt+=number')
screen:expect([[
- {4:0 }{1:øøøøøøøøøøøø^øøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }{102:øøøøøøøøøøøø^øøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
feed('gj')
screen:expect([[
- {4:0 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}{1:øøøøøøøøø^øøø }|
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}{102:øøøøøøøøø^øøø }|
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
feed('gj')
screen:expect([[
- {3:1 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {4:0 }{1:aaaaaaaaaaaa^aaaaaa}|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {101:1 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {103:0 }{102:aaaaaaaaaaaa^aaaaaa}|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
feed('gj')
screen:expect([[
- {3:1 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {4:0 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}{1:aaaaaaaaa^aaa }|
+ {101:1 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {103:0 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}{102:aaaaaaaaa^aaa }|
|
]])
-- updated in Insert mode
feed('I')
screen:expect([[
- {3:1 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {4:0 }{1:^aaaaaaaaaaaaaaaaaa}|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {101:1 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {103:0 }{102:^aaaaaaaaaaaaaaaaaa}|
+ {101: }{100:>>>}aaaaaaaaaaaa |
{5:-- INSERT --} |
]])
feed('<Esc>gg')
screen:expect([[
- {4:0 }{1:^øøøøøøøøøøøøøøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }{102:^øøøøøøøøøøøøøøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
command('inoremap <F2> <Cmd>call cursor(1, 1)<CR>')
feed('A')
screen:expect([[
- {4:0 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}{1:øøøøøøøøøøøø^ }|
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}{102:øøøøøøøøøøøø^ }|
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
{5:-- INSERT --} |
]])
feed('<F2>')
screen:expect([[
- {4:0 }{1:^øøøøøøøøøøøøøøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }{102:^øøøøøøøøøøøøøøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
{5:-- INSERT --} |
]])
end)
@@ -1137,22 +1079,16 @@ describe('CursorLine and CursorLineNr highlights', function()
-- oldtest: Test_cursorline_after_yank()
it('always updated. vim-patch:8.1.0849', function()
local screen = Screen.new(50, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.SlateBlue },
- [2] = { bold = true, foreground = Screen.colors.Brown },
- [3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [4] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Gray90 },
- [5] = { background = Screen.colors.Gray90 },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.LightRed },
- [8] = { foreground = Screen.colors.Brown },
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.LightRed },
+ [101] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Grey90 },
+ }
screen:attach()
command('set cursorline relativenumber')
command('call setline(1, ["","1","2","3",""])')
feed('Gy3k')
screen:expect([[
- {2: 0 }{5:^1 }|
+ {15: 0 }{21:^1 }|
{8: 1 }2 |
{8: 2 }3 |
{8: 3 } |
@@ -1162,7 +1098,7 @@ describe('CursorLine and CursorLineNr highlights', function()
screen:expect([[
{8: 2 }1 |
{8: 1 }2 |
- {2: 0 }{5:^3 }|
+ {15: 0 }{21:^3 }|
{8: 1 } |
4 lines yanked |
]])
@@ -1171,37 +1107,25 @@ describe('CursorLine and CursorLineNr highlights', function()
-- oldtest: Test_cursorline_with_visualmode()
it('with visual area. vim-patch:8.1.1001', function()
local screen = Screen.new(50, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.SlateBlue },
- [2] = { bold = true, foreground = Screen.colors.Brown },
- [3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [4] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Gray90 },
- [5] = { background = Screen.colors.Gray90 },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.LightRed },
- [8] = { foreground = Screen.colors.Brown },
- [9] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
- [10] = { bold = true },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Grey90 },
+ [101] = { background = Screen.colors.LightRed },
+ }
screen:attach()
command('set cursorline')
command('call setline(1, repeat(["abc"], 50))')
feed('V<C-f>zbkkjk')
screen:expect([[
- {9:abc} |
- ^a{9:bc} |
+ {17:abc} |
+ ^a{17:bc} |
abc |*2
- {10:-- VISUAL LINE --} |
+ {5:-- VISUAL LINE --} |
]])
end)
-- oldtest: Test_cursorline_callback()
it('is updated if cursor is moved up from timer vim-patch:8.2.4591', function()
local screen = Screen.new(50, 8)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Gray90 }, -- CursorLine
- [2] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText
- })
screen:attach()
exec([[
call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd'])
@@ -1219,8 +1143,8 @@ describe('CursorLine and CursorLineNr highlights', function()
aaaaa |
bbbbb |
ccccc |
- {1:^ddddd }|
- {2:~ }|*3
+ {21:^ddddd }|
+ {1:~ }|*3
|
]],
timeout = 100,
@@ -1228,10 +1152,10 @@ describe('CursorLine and CursorLineNr highlights', function()
screen:expect({
grid = [[
aaaaa |
- {1:^bbbbb }|
+ {21:^bbbbb }|
ccccc |
ddddd |
- {2:~ }|*3
+ {1:~ }|*3
|
]],
})
@@ -1239,17 +1163,10 @@ describe('CursorLine and CursorLineNr highlights', function()
it('with split windows in diff mode', function()
local screen = Screen.new(50, 12)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { bold = true, background = Screen.colors.Red },
- [3] = { background = Screen.colors.LightMagenta },
- [4] = { reverse = true },
- [5] = { background = Screen.colors.LightBlue },
- [6] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.Red, foreground = Screen.colors.White },
- [8] = { bold = true, foreground = Screen.colors.Blue1 },
- [9] = { bold = true, reverse = true },
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.Plum1, underline = true },
+ [101] = { background = Screen.colors.Red1, bold = true, underline = true },
+ }
screen:attach()
command('hi CursorLine ctermbg=red ctermfg=white guibg=red guifg=white')
@@ -1264,26 +1181,26 @@ describe('CursorLine and CursorLineNr highlights', function()
feed('<esc>gg')
command('windo diffthis')
screen:expect([[
- {1: }{7:line 1 some text }│{1: }{7:^line 1 some text }|
- {1: }{3:line 2 mo}{2:Re text!}{3: }│{1: }{3:line 2 mo}{2:re text}{3: }|
- {1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |*2
- {1: }last line ... │{1: }last line ... |
- {1: } │{1: } |
- {8:~ }│{8:~ }|*3
- {4:[No Name] [+] }{9:[No Name] [+] }|
+ {7: }{9:line 1 some text }│{7: }{9:^line 1 some text }|
+ {7: }{4:line 2 mo}{27:Re text!}{4: }│{7: }{4:line 2 mo}{27:re text}{4: }|
+ {7: }{22:extra line! }│{7: }{23:----------------------}|
+ {7: }extra line! │{7: }extra line! |*2
+ {7: }last line ... │{7: }last line ... |
+ {7: } │{7: } |
+ {1:~ }│{1:~ }|*3
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]])
feed('jjjjj')
screen:expect([[
- {1: }line 1 some text │{1: }line 1 some text |
- {1: }{3:line 2 mo}{2:Re text!}{3: }│{1: }{3:line 2 mo}{2:re text}{3: }|
- {1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |*2
- {1: }last line ... │{1: }last line ... |
- {1: }{7: }│{1: }{7:^ }|
- {8:~ }│{8:~ }|*3
- {4:[No Name] [+] }{9:[No Name] [+] }|
+ {7: }line 1 some text │{7: }line 1 some text |
+ {7: }{4:line 2 mo}{27:Re text!}{4: }│{7: }{4:line 2 mo}{27:re text}{4: }|
+ {7: }{22:extra line! }│{7: }{23:----------------------}|
+ {7: }extra line! │{7: }extra line! |*2
+ {7: }last line ... │{7: }last line ... |
+ {7: }{9: }│{7: }{9:^ }|
+ {1:~ }│{1:~ }|*3
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]])
@@ -1291,53 +1208,25 @@ describe('CursorLine and CursorLineNr highlights', function()
-- Rendered as underline in a diff-line. #9028
command('hi CursorLine ctermbg=red ctermfg=NONE guibg=red guifg=NONE')
feed('kkkk')
- screen:expect(
- [[
- {1: }line 1 some text │{1: }line 1 some text |
- {1: }{11:line 2 mo}{12:Re text!}{11: }│{1: }{11:^line 2 mo}{12:re text}{11: }|
- {1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |*2
- {1: }last line ... │{1: }last line ... |
- {1: } │{1: } |
- {8:~ }│{8:~ }|*3
- {4:[No Name] [+] }{9:[No Name] [+] }|
+ screen:expect([[
+ {7: }line 1 some text │{7: }line 1 some text |
+ {7: }{100:line 2 mo}{101:Re text!}{100: }│{7: }{100:^line 2 mo}{101:re text}{100: }|
+ {7: }{22:extra line! }│{7: }{23:----------------------}|
+ {7: }extra line! │{7: }extra line! |*2
+ {7: }last line ... │{7: }last line ... |
+ {7: } │{7: } |
+ {1:~ }│{1:~ }|*3
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
- ]],
- {
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { bold = true, background = Screen.colors.Red },
- [3] = { background = Screen.colors.LightMagenta },
- [4] = { reverse = true },
- [5] = { background = Screen.colors.LightBlue },
- [6] = {
- background = Screen.colors.LightCyan1,
- bold = true,
- foreground = Screen.colors.Blue1,
- },
- [7] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [8] = { bold = true, foreground = Screen.colors.Blue1 },
- [9] = { bold = true, reverse = true },
- [10] = { bold = true },
- [11] = { underline = true, background = Screen.colors.LightMagenta },
- [12] = { bold = true, underline = true, background = Screen.colors.Red },
- }
- )
+ ]])
end)
-- oldtest: Test_diff_with_cursorline_number()
it('CursorLineNr shows correctly just below filler lines', function()
local screen = Screen.new(50, 12)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.LightBlue },
- [5] = { background = Screen.colors.Red, foreground = Screen.colors.White },
- [6] = { background = Screen.colors.White, bold = true, foreground = Screen.colors.Black },
- [7] = { bold = true, foreground = Screen.colors.Blue1 },
- [8] = { bold = true, reverse = true },
- [9] = { foreground = Screen.colors.Brown },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Black, bold = true, background = Screen.colors.Grey100 },
+ }
screen:attach()
command('hi CursorLine guibg=red guifg=white')
@@ -1350,22 +1239,22 @@ describe('CursorLine and CursorLineNr highlights', function()
command('windo diffthis')
command('1wincmd w')
screen:expect([[
- {1: }{9: }{2:-------------------}│{1: }{9: 1 }{4:baz }|
- {1: }{6: 1 }{5:^foo }│{1: }{6: 2 }{5:foo }|
- {1: }{9: 2 }foo │{1: }{9: 3 }foo |
- {1: }{9: 3 }bar │{1: }{9: 4 }bar |
- {7:~ }│{7:~ }|*6
- {8:[No Name] [+] }{3:[No Name] [+] }|
+ {7: }{8: }{23:-------------------}│{7: }{8: 1 }{22:baz }|
+ {7: }{100: 1 }{9:^foo }│{7: }{100: 2 }{9:foo }|
+ {7: }{8: 2 }foo │{7: }{8: 3 }foo |
+ {7: }{8: 3 }bar │{7: }{8: 4 }bar |
+ {1:~ }│{1:~ }|*6
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
command('set cursorlineopt=number')
screen:expect([[
- {1: }{9: }{2:-------------------}│{1: }{9: 1 }{4:baz }|
- {1: }{6: 1 }^foo │{1: }{6: 2 }{5:foo }|
- {1: }{9: 2 }foo │{1: }{9: 3 }foo |
- {1: }{9: 3 }bar │{1: }{9: 4 }bar |
- {7:~ }│{7:~ }|*6
- {8:[No Name] [+] }{3:[No Name] [+] }|
+ {7: }{8: }{23:-------------------}│{7: }{8: 1 }{22:baz }|
+ {7: }{100: 1 }^foo │{7: }{100: 2 }{9:foo }|
+ {7: }{8: 2 }foo │{7: }{8: 3 }foo |
+ {7: }{8: 3 }bar │{7: }{8: 4 }bar |
+ {1:~ }│{1:~ }|*6
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
end)
@@ -1376,13 +1265,9 @@ describe('CursorColumn highlight', function()
before_each(function()
clear()
screen = Screen.new(50, 8)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Gray90 }, -- CursorColumn
- [2] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText
- [3] = { bold = true }, -- ModeMsg
- [4] = { background = Screen.colors.Red },
- [5] = { background = Screen.colors.Blue },
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.Blue1 },
+ }
screen:attach()
end)
@@ -1393,31 +1278,31 @@ describe('CursorColumn highlight', function()
call cursor(2, 2)
]])
screen:expect([[
- 1234567{1:8}9 |
+ 1234567{21:8}9 |
a ^ b |
- {2:~ }|*5
+ {1:~ }|*5
|
]])
feed('i')
screen:expect([[
- 1{1:2}3456789 |
+ 1{21:2}3456789 |
a^ b |
- {2:~ }|*5
- {3:-- INSERT --} |
+ {1:~ }|*5
+ {5:-- INSERT --} |
]])
feed('<C-O>')
screen:expect([[
- 1234567{1:8}9 |
+ 1234567{21:8}9 |
a ^ b |
- {2:~ }|*5
- {3:-- (insert) --} |
+ {1:~ }|*5
+ {5:-- (insert) --} |
]])
feed('i')
screen:expect([[
- 1{1:2}3456789 |
+ 1{21:2}3456789 |
a^ b |
- {2:~ }|*5
- {3:-- INSERT --} |
+ {1:~ }|*5
+ {5:-- INSERT --} |
]])
end)
@@ -1436,11 +1321,11 @@ describe('CursorColumn highlight', function()
]])
screen:expect({
grid = [[
- aaaa{1:a} |
- bbbb{1:b} |
- cccc{1:c} |
+ aaaa{21:a} |
+ bbbb{21:b} |
+ cccc{21:c} |
dddd^d |
- {2:~ }|*3
+ {1:~ }|*3
|
]],
timeout = 100,
@@ -1448,10 +1333,10 @@ describe('CursorColumn highlight', function()
screen:expect({
grid = [[
^aaaaa |
- {1:b}bbbb |
- {1:c}cccc |
- {1:d}dddd |
- {2:~ }|*3
+ {21:b}bbbb |
+ {21:c}cccc |
+ {21:d}dddd |
+ {1:~ }|*3
|
]],
})
@@ -1466,34 +1351,34 @@ describe('CursorColumn highlight', function()
insert('line 1\nline 2\nline 3')
feed('k')
screen:expect([[
- line {4:1} |
- {5:line ^2 }|
- line {4:3} |
- {2:~ }|*4
+ line {30:1} |
+ {100:line ^2 }|
+ line {30:3} |
+ {1:~ }|*4
|
]])
feed('l')
screen:expect([[
- line 1{4: } |
- {5:line 2^ }|
- line 3{4: } |
- {2:~ }|*4
+ line 1{30: } |
+ {100:line 2^ }|
+ line 3{30: } |
+ {1:~ }|*4
|
]])
feed('l')
screen:expect([[
- line 1 {4: } |
- {5:line 2 ^ }|
- line 3 {4: } |
- {2:~ }|*4
+ line 1 {30: } |
+ {100:line 2 ^ }|
+ line 3 {30: } |
+ {1:~ }|*4
|
]])
feed('l')
screen:expect([[
- line 1 {4: } |
- {5:line 2 ^ }|
- line 3 {4: } |
- {2:~ }|*4
+ line 1 {30: } |
+ {100:line 2 ^ }|
+ line 3 {30: } |
+ {1:~ }|*4
|
]])
end)
@@ -1505,17 +1390,11 @@ describe('ColorColumn highlight', function()
before_each(function()
clear()
screen = Screen.new(40, 15)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.LightRed }, -- ColorColumn
- [2] = { background = Screen.colors.Grey90 }, -- CursorLine
- [3] = { foreground = Screen.colors.Brown }, -- LineNr
- [4] = { foreground = Screen.colors.Brown, bold = true }, -- CursorLineNr
- [5] = { foreground = Screen.colors.Blue, bold = true }, -- NonText
- [6] = { foreground = Screen.colors.Blue, background = Screen.colors.LightRed, bold = true },
- [7] = { reverse = true, bold = true }, -- StatusLine
- [8] = { reverse = true }, -- StatusLineNC
- [9] = { background = Screen.colors.Grey90, foreground = Screen.colors.Red },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
+ [101] = { background = Screen.colors.LightRed },
+ [102] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.LightRed },
+ }
screen:attach()
end)
@@ -1533,16 +1412,16 @@ describe('ColorColumn highlight', function()
buf X
]])
screen:expect([[
- {4: 1 }11{1:1}11111{1:1}1 |
- {3: 2 }22{1:2}22222{1:2}22 |
- {3: 3 }33{1:3}33333{1:3}3 |
- {5:~ }|*3
- {8:X }|
- {4: 1 }^11{1:1}11111{1:1}1 |
- {3: 2 }22{1:2}22222{1:2}22 |
- {3: 3 }33{1:3}33333{1:3}3 |
- {5:~ }|*3
- {7:X }|
+ {15: 1 }11{101:1}11111{101:1}1 |
+ {8: 2 }22{101:2}22222{101:2}22 |
+ {8: 3 }33{101:3}33333{101:3}3 |
+ {1:~ }|*3
+ {2:X }|
+ {15: 1 }^11{101:1}11111{101:1}1 |
+ {8: 2 }22{101:2}22222{101:2}22 |
+ {8: 3 }33{101:3}33333{101:3}3 |
+ {1:~ }|*3
+ {3:X }|
|
]])
end)
@@ -1554,9 +1433,9 @@ describe('ColorColumn highlight', function()
set co=40 linebreak bri briopt=shift:2 cc=40,41,43
]])
screen:expect([[
- ^The quick brown fox jumped over the {1: }|
- {1: } {1:l}azy dogs |
- {5:~ }|*12
+ ^The quick brown fox jumped over the {101: }|
+ {101: } {101:l}azy dogs |
+ {1:~ }|*12
|
]])
end)
@@ -1568,9 +1447,9 @@ describe('ColorColumn highlight', function()
set co=40 showbreak=+++>\\ cc=40,41,43
]])
screen:expect([[
- ^The quick brown fox jumped over the laz{1:y}|
- {6:+}{5:+}{6:+}{5:>\} dogs |
- {5:~ }|*12
+ ^The quick brown fox jumped over the laz{101:y}|
+ {102:+}{1:+}{102:+}{1:>\} dogs |
+ {1:~ }|*12
|
]])
end)
@@ -1579,17 +1458,17 @@ describe('ColorColumn highlight', function()
screen:try_resize(40, 2)
command('set colorcolumn=30 cursorline')
screen:expect([[
- {2:^ }{1: }{2: }|
+ {21:^ }{101: }{21: }|
|
]])
command('hi clear ColorColumn')
screen:expect([[
- {2:^ }|
+ {21:^ }|
|
]])
command('hi ColorColumn guifg=Red')
screen:expect([[
- {2:^ }{9: }{2: }|
+ {21:^ }{100: }{21: }|
|
]])
end)
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index fcfd94ff7c..5faa2b95a9 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -30,18 +30,9 @@ describe('ui/ext_messages', function()
clear()
screen = Screen.new(25, 5)
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, reverse = true },
- [7] = { background = Screen.colors.Yellow },
- [8] = { foreground = Screen.colors.Red },
- [9] = { special = Screen.colors.Red, undercurl = true },
- [10] = { foreground = Screen.colors.Brown },
- })
+ screen:add_extra_attr_ids {
+ [100] = { undercurl = true, special = Screen.colors.Red },
+ }
end)
after_each(function()
os.remove(fname)
@@ -57,7 +48,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { '\ntest\n[O]k: ', 4 } },
+ content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm',
},
},
@@ -85,7 +76,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { '\ntest\n[O]k: ', 4 } },
+ content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm',
},
},
@@ -99,7 +90,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { '\ntest\n[O]k: ', 4 } },
+ content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm',
},
{
@@ -107,7 +98,7 @@ describe('ui/ext_messages', function()
kind = 'echo',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -118,23 +109,13 @@ describe('ui/ext_messages', function()
feed(':%s/i/X/gc<cr>')
screen:expect {
grid = [[
- l{7:i}ne 1 |
- l{8:i}ne ^2 |
+ l{2:i}ne 1 |
+ l{10:i}ne ^2 |
{1:~ }|*3
]],
- attr_ids = {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, reverse = true },
- [7] = { reverse = true },
- [8] = { background = Screen.colors.Yellow },
- },
messages = {
{
- content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 4 } },
+ content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 6 } },
kind = 'confirm_sub',
},
},
@@ -148,16 +129,12 @@ describe('ui/ext_messages', function()
screen:expect {
grid = [[
line 1 |
- {MATCH:.*}|
+ line ^2 |
{1:~ }|*3
]],
- attr_ids = {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { foreground = Screen.colors.Red },
- },
messages = {
{
- content = { { 'W10: Warning: Changing a readonly file', 7 } },
+ content = { { 'W10: Warning: Changing a readonly file', 19 } },
kind = 'wmsg',
},
},
@@ -171,18 +148,9 @@ describe('ui/ext_messages', function()
line 2 |
{1:~ }|*3
]],
- attr_ids = {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, reverse = true },
- [7] = { foreground = Screen.colors.Red },
- },
messages = {
{
- content = { { 'search hit BOTTOM, continuing at TOP', 7 } },
+ content = { { 'search hit BOTTOM, continuing at TOP', 19 } },
kind = 'wmsg',
},
},
@@ -198,15 +166,15 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'Error detected while processing :', 2 } },
+ content = { { 'Error detected while processing :', 9 } },
kind = 'emsg',
},
{
- content = { { 'E605: Exception not caught: foo', 2 } },
+ content = { { 'E605: Exception not caught: foo', 9 } },
kind = '',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -239,7 +207,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'raa', 2 } },
+ content = { { 'raa', 9 } },
kind = 'echoerr',
} },
}
@@ -266,15 +234,15 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'bork', 2 } },
+ content = { { 'bork', 9 } },
kind = 'echoerr',
},
{
- content = { { 'fail', 2 } },
+ content = { { 'fail', 9 } },
kind = 'echoerr',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -288,19 +256,19 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'bork', 2 } },
+ content = { { 'bork', 9 } },
kind = 'echoerr',
},
{
- content = { { 'fail', 2 } },
+ content = { { 'fail', 9 } },
kind = 'echoerr',
},
{
- content = { { 'extrafail', 2 } },
+ content = { { 'extrafail', 9 } },
kind = 'echoerr',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -322,7 +290,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'problem', 2 } },
+ content = { { 'problem', 9 } },
kind = 'echoerr',
} },
cmdline = {
@@ -350,15 +318,15 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
msg_history = {
- { kind = 'echoerr', content = { { 'raa', 2 } } },
- { kind = 'echoerr', content = { { 'bork', 2 } } },
- { kind = 'echoerr', content = { { 'fail', 2 } } },
- { kind = 'echoerr', content = { { 'extrafail', 2 } } },
- { kind = 'echoerr', content = { { 'problem', 2 } } },
+ { kind = 'echoerr', content = { { 'raa', 9 } } },
+ { kind = 'echoerr', content = { { 'bork', 9 } } },
+ { kind = 'echoerr', content = { { 'fail', 9 } } },
+ { kind = 'echoerr', content = { { 'extrafail', 9 } } },
+ { kind = 'echoerr', content = { { 'problem', 9 } } },
},
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -382,7 +350,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'bork\nfail', 2 } },
+ content = { { 'bork\nfail', 9 } },
kind = 'echoerr',
} },
}
@@ -395,13 +363,13 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
msg_history = {
{
- content = { { 'bork\nfail', 2 } },
+ content = { { 'bork\nfail', 9 } },
kind = 'echoerr',
},
},
@@ -415,8 +383,8 @@ describe('ui/ext_messages', function()
feed('/line<cr>')
screen:expect {
grid = [[
- {7:^line} 1 |
- {7:line} 2 |
+ {10:^line} 1 |
+ {10:line} 2 |
{1:~ }|*3
]],
messages = {
@@ -427,8 +395,8 @@ describe('ui/ext_messages', function()
feed('n')
screen:expect {
grid = [[
- {7:line} 1 |
- {7:^line} 2 |
+ {10:line} 1 |
+ {10:^line} 2 |
{1:~ }|*3
]],
messages = {
@@ -448,15 +416,15 @@ describe('ui/ext_messages', function()
{
content = {
{ '\nErrorMsg ' },
- { 'xxx', 2 },
+ { 'xxx', 9 },
{ ' ' },
- { 'ctermfg=', 5 },
+ { 'ctermfg=', 18 },
{ '15 ' },
- { 'ctermbg=', 5 },
+ { 'ctermbg=', 18 },
{ '1 ' },
- { 'guifg=', 5 },
+ { 'guifg=', 18 },
{ 'White ' },
- { 'guibg=', 5 },
+ { 'guibg=', 18 },
{ 'Red' },
},
kind = '',
@@ -476,7 +444,7 @@ describe('ui/ext_messages', function()
messages = {
{ content = { { 'x #1' } }, kind = '' },
{ content = { { 'y #2' } }, kind = '' },
- { content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' },
+ { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
},
}
end)
@@ -489,7 +457,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { '-- INSERT --', 3 } },
+ showmode = { { '-- INSERT --', 5 } },
}
feed('alphpabet<cr>alphanum<cr>')
@@ -500,7 +468,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*2
]],
- showmode = { { '-- INSERT --', 3 } },
+ showmode = { { '-- INSERT --', 5 } },
}
feed('<c-x>')
@@ -511,7 +479,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*2
]],
- showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 3 } },
+ showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 5 } },
}
feed('<c-p>')
@@ -527,7 +495,7 @@ describe('ui/ext_messages', function()
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
pos = 1,
},
- showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 1 of 2', 4 } },
+ showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
}
-- echomsg and showmode don't overwrite each other, this is the same
@@ -549,7 +517,7 @@ describe('ui/ext_messages', function()
content = { { 'stuff' } },
kind = 'echomsg',
} },
- showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 1 of 2', 4 } },
+ showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
}
feed('<c-p>')
@@ -569,7 +537,7 @@ describe('ui/ext_messages', function()
content = { { 'stuff' } },
kind = 'echomsg',
} },
- showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 2 of 2', 4 } },
+ showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 2 of 2', 6 } },
}
feed('<esc>:messages<cr>')
@@ -586,7 +554,7 @@ describe('ui/ext_messages', function()
} },
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -600,7 +568,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
}
feed('i')
@@ -609,7 +577,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { '-- INSERT --recording @q', 3 } },
+ showmode = { { '-- INSERT --recording @q', 5 } },
}
feed('<esc>')
@@ -618,7 +586,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
}
feed('q')
@@ -637,7 +605,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
mode = 'normal',
}
@@ -647,7 +615,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
mode = 'insert',
}
@@ -657,7 +625,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
mode = 'normal',
}
@@ -686,7 +654,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { '-- INSERT --', 3 } },
+ showmode = { { '-- INSERT --', 5 } },
ruler = { { '0,1 All' } },
}
feed('abcde<cr>12345<esc>')
@@ -754,7 +722,7 @@ describe('ui/ext_messages', function()
abcde |
^ |
{1:~ }|*2
- {6:<o Name] [+] 2,0-1 All}|
+ {3:<o Name] [+] 2,0-1 All}|
]])
end)
@@ -794,7 +762,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'bork', 2 } },
+ content = { { 'bork', 9 } },
kind = 'echoerr',
} },
}
@@ -819,7 +787,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'E117: Unknown function: nosuchfunction', 2 } },
+ content = { { 'E117: Unknown function: nosuchfunction', 9 } },
kind = 'emsg',
},
},
@@ -834,12 +802,12 @@ describe('ui/ext_messages', function()
msg_history = {
{ kind = 'echomsg', content = { { 'howdy' } } },
{ kind = '', content = { { 'Type :qa and press <Enter> to exit Nvim' } } },
- { kind = 'echoerr', content = { { 'bork', 2 } } },
- { kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 2 } } },
+ { kind = 'echoerr', content = { { 'bork', 9 } } },
+ { kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 9 } } },
},
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -911,7 +879,7 @@ error
stack traceback:
[C]: in function 'error'
[string ":lua"]:1: in main chunk]],
- 2,
+ 9,
},
},
kind = 'lua_error',
@@ -931,7 +899,7 @@ stack traceback:
messages = {
{
content = {
- { "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 2 },
+ { "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 9 },
},
kind = 'rpc_error',
},
@@ -956,7 +924,7 @@ stack traceback:
{
content = {
{ '\nn Q @@\nn Y y$\nn j ' },
- { '*', 5 },
+ { '*', 18 },
{ ' k' },
},
kind = '',
@@ -997,7 +965,7 @@ stack traceback:
feed('z=')
screen:expect {
grid = [[
- {9:helllo} |
+ {100:helllo} |
{1:~ }|*3
{1:^~ }|
]],
@@ -1016,7 +984,7 @@ stack traceback:
feed('1')
screen:expect {
grid = [[
- {9:helllo} |
+ {100:helllo} |
{1:~ }|*3
{1:^~ }|
]],
@@ -1054,7 +1022,7 @@ stack traceback:
{1:~ }|*4
]],
messages = {
- { content = { { 'wow, ', 7 }, { 'such\n\nvery ', 2 }, { 'color', 10 } }, kind = 'echomsg' },
+ { content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
},
}
@@ -1076,10 +1044,10 @@ stack traceback:
{1:~ }|*4
]],
messages = {
- { content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' },
+ { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
},
msg_history = {
- { content = { { 'wow, ', 7 }, { 'such\n\nvery ', 2 }, { 'color', 10 } }, kind = 'echomsg' },
+ { content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
},
}
@@ -1108,18 +1076,10 @@ describe('ui/builtin messages', function()
clear()
screen = Screen.new(60, 7)
screen:attach({ rgb = true, ext_popupmenu = true })
- screen:set_default_attr_ids {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true, reverse = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, foreground = Screen.colors.Magenta },
- [7] = { background = Screen.colors.Grey20 },
- [8] = { reverse = true },
- [9] = { background = Screen.colors.LightRed },
- [10] = { background = Screen.colors.Yellow },
- [11] = { foreground = Screen.colors.Brown },
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.LightRed },
+ [101] = { background = Screen.colors.Grey20 },
+ [102] = { foreground = Screen.colors.Magenta1, bold = true },
}
end)
@@ -1129,12 +1089,12 @@ describe('ui/builtin messages', function()
screen:expect {
grid = [[
{3: }|
- {2:Error invoking 'test_method' on channel 1:} |
- {2:complete} |
- {2:error} |
+ {9:Error invoking 'test_method' on channel 1:} |
+ {9:complete} |
+ {9:error} |
|
- {2:message} |
- {4:Press ENTER or type command to continue}^ |
+ {9:message} |
+ {6:Press ENTER or type command to continue}^ |
]],
request_cb = function(name)
if name == 'test_method' then
@@ -1152,8 +1112,8 @@ describe('ui/builtin messages', function()
{1:~ }|*2
{3: }|
:hi ErrorMsg |
- ErrorMsg {2:xxx} {5:ctermfg=}15 {5:ctermbg=}1 {5:guifg=}White {5:guibg=}Red |
- {4:Press ENTER or type command to continue}^ |
+ ErrorMsg {9:xxx} {18:ctermfg=}15 {18:ctermbg=}1 {18:guifg=}White {18:guibg=}Red |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@@ -1161,12 +1121,12 @@ describe('ui/builtin messages', function()
feed(':hi ErrorMsg<cr>')
screen:expect([[
:hi ErrorMsg |
- ErrorMsg {2:xxx} {5:ctermfg=}15 |
- {5:ctermbg=}1 |
- {5:guifg=}White|
- {5:guibg=}Red |
- {4:Press ENTER or type command to}|
- {4: continue}^ |
+ ErrorMsg {9:xxx} {18:ctermfg=}15 |
+ {18:ctermbg=}1 |
+ {18:guifg=}White|
+ {18:guibg=}Red |
+ {6:Press ENTER or type command to}|
+ {6: continue}^ |
]])
feed('<cr>')
@@ -1180,13 +1140,13 @@ describe('ui/builtin messages', function()
screen:try_resize(110, 7)
feed(':syntax list vimComment<cr>')
screen:expect([[
- {6:--- Syntax items ---} |
- vimComment {5:xxx} {5:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {5:excludenl} {5:contains}=@vimCommentGroup,vimCommentString |
+ {102:--- Syntax items ---} |
+ vimComment {18:xxx} {18:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {18:excludenl} {18:contains}=@vimCommentGroup,vimCommentString |
|
- {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 {5:contains}=@vimCommentGroup,vimCommentString |
- {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:contains}=@vimCommentGroup,vimCommentString |
- {5:links to} Comment |
- {4:Press ENTER or type command to continue}^ |
+ {18:match} /\<endif\s\+".*$/ms=s+5,lc=5 {18:contains}=@vimCommentGroup,vimCommentString |
+ {18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:contains}=@vimCommentGroup,vimCommentString |
+ {18:links to} Comment |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@@ -1194,12 +1154,12 @@ describe('ui/builtin messages', function()
feed(':syntax list vimComment<cr>')
screen:expect([[
|
- {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 |
- {5:contains}=@vimCommentGroup,vimCommentString |
- {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:c}|
- {5:ontains}=@vimCommentGroup,vimCommentString |
- {5:links to} Comment |
- {4:Press ENTER or type command to continue}^ |
+ {18:match} /\<endif\s\+".*$/ms=s+5,lc=5 |
+ {18:contains}=@vimCommentGroup,vimCommentString |
+ {18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:c}|
+ {18:ontains}=@vimCommentGroup,vimCommentString |
+ {18:links to} Comment |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@@ -1272,7 +1232,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
^ |
{1:~ }|*5
- {7: 0,0-1 All }|
+ {101: 0,0-1 All }|
]],
}
@@ -1281,7 +1241,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
^ |
{1:~ }|*5
- {7: 0,0-1 100% }|
+ {101: 0,0-1 100% }|
]],
}
end)
@@ -1295,7 +1255,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{3: }|
line 1 |
line 2 |
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]],
}
@@ -1319,7 +1279,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
|
{1:~ }|
- {8:[No Name] }|
+ {2:[No Name] }|
^ |
{1:~ }|
{3:[No Name] }|
@@ -1331,12 +1291,12 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
screen:expect {
grid = [[
:set colorcolumn=10 | digraphs |
- NU {5:^@} 10 SH {5:^A} 1 SX {5:^B} 2 EX {5:^C} 3 |
- ET {5:^D} 4 EQ {5:^E} 5 AK {5:^F} 6 BL {5:^G} 7 |
- BS {5:^H} 8 HT {5:^I} 9 LF {5:^@} 10 VT {5:^K} 11 |
- FF {5:^L} 12 CR {5:^M} 13 SO {5:^N} 14 SI {5:^O} 15 |
- DL {5:^P} 16 D1 {5:^Q} 17 D2 {5:^R} 18 D3 {5:^S} 19 |
- {4:-- More --}^ |
+ NU {18:^@} 10 SH {18:^A} 1 SX {18:^B} 2 EX {18:^C} 3 |
+ ET {18:^D} 4 EQ {18:^E} 5 AK {18:^F} 6 BL {18:^G} 7 |
+ BS {18:^H} 8 HT {18:^I} 9 LF {18:^@} 10 VT {18:^K} 11 |
+ FF {18:^L} 12 CR {18:^M} 13 SO {18:^N} 14 SI {18:^O} 15 |
+ DL {18:^P} 16 D1 {18:^Q} 17 D2 {18:^R} 18 D3 {18:^S} 19 |
+ {6:-- More --}^ |
]],
}
@@ -1345,8 +1305,8 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
|
{1:~ }|
- {8:[No Name] }|
- ^ {9: } |
+ {2:[No Name] }|
+ ^ {100: } |
{1:~ }|
{3:[No Name] }|
|
@@ -1357,13 +1317,13 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':set colorcolumn=5 | lua error("x\\n\\nx")<cr>')
screen:expect {
grid = [[
- {2:E5108: Error executing lua [string ":lua"]:1: x} |
+ {9:E5108: Error executing lua [string ":lua"]:1: x} |
|
- {2:x} |
- {2:stack traceback:} |
- {2: [C]: in function 'error'} |
- {2: [string ":lua"]:1: in main chunk} |
- {4:Press ENTER or type command to continue}^ |
+ {9:x} |
+ {9:stack traceback:} |
+ {9: [C]: in function 'error'} |
+ {9: [string ":lua"]:1: in main chunk} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
@@ -1372,8 +1332,8 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
|
{1:~ }|
- {8:[No Name] }|
- ^ {9: } |
+ {2:[No Name] }|
+ ^ {100: } |
{1:~ }|
{3:[No Name] }|
|
@@ -1384,12 +1344,12 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':set colorcolumn=5 | lua error("x\\n\\n\\nx")<cr>')
screen:expect {
grid = [[
- {2:E5108: Error executing lua [string ":lua"]:1: x} |
+ {9:E5108: Error executing lua [string ":lua"]:1: x} |
|*2
- {2:x} |
- {2:stack traceback:} |
- {2: [C]: in function 'error'} |
- {4:-- More --}^ |
+ {9:x} |
+ {9:stack traceback:} |
+ {9: [C]: in function 'error'} |
+ {6:-- More --}^ |
]],
}
@@ -1397,11 +1357,11 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
screen:expect {
grid = [[
|*2
- {2:x} |
- {2:stack traceback:} |
- {2: [C]: in function 'error'} |
- {2: [string ":lua"]:1: in main chunk} |
- {4:Press ENTER or type command to continue}^ |
+ {9:x} |
+ {9:stack traceback:} |
+ {9: [C]: in function 'error'} |
+ {9: [string ":lua"]:1: in main chunk} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
end)
@@ -1417,10 +1377,10 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
|
{1:~ }|
{3: }|
- {10:wow, }{2:such} |
+ {10:wow, }{9:such} |
|
- {2:very }{11:color} |
- {4:Press ENTER or type command to continue}^ |
+ {9:very }{8:color} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
@@ -1439,10 +1399,10 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
|
{1:~ }|
{3: }|
- {10:wow, }{2:such} |
+ {10:wow, }{9:such} |
|
- {2:very }{11:color} |
- {4:Press ENTER or type command to continue}^ |
+ {9:very }{8:color} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
end)
@@ -1453,19 +1413,19 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed('gggQ<CR><CR>1<CR><CR>vi')
screen:expect([[
Entering Ex mode. Type "visual" to go to Normal mode. |
- {11: 2 }bbb |
- {11: 3 }ccc |
+ {8: 2 }bbb |
+ {8: 3 }ccc |
:1 |
- {11: 1 }aaa |
- {11: 2 }bbb |
+ {8: 1 }aaa |
+ {8: 2 }bbb |
:vi^ |
]])
feed('<CR>')
screen:expect([[
- {11: 1 }aaa |
- {11: 2 }^bbb |
- {11: 3 }ccc |
- {11: 4 } |
+ {8: 1 }aaa |
+ {8: 2 }^bbb |
+ {8: 3 }ccc |
+ {8: 4 } |
{1:~ }|*2
|
]])
@@ -1506,7 +1466,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
aaa |
bbb |
ccc |
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]],
}
end
@@ -1538,7 +1498,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{1:~ }|*3
{3: }|
|
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<CR>')
screen:expect([[
@@ -1596,16 +1556,6 @@ describe('ui/ext_messages', function()
clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
screen = Screen.new(80, 24)
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { reverse = true },
- [7] = { bold = true, reverse = true },
- [8] = { background = Screen.colors.Plum1 },
- })
end)
it('supports intro screen', function()
@@ -1619,18 +1569,18 @@ describe('ui/ext_messages', function()
{1:~ }Nvim is open source and freely distributable{1: }|
{1:~ }https://neovim.io/#chat{1: }|
{1:~ }|
- {1:~ }type :help nvim{5:<Enter>} if you are new! {1: }|
- {1:~ }type :checkhealth{5:<Enter>} to optimize Nvim{1: }|
- {1:~ }type :q{5:<Enter>} to exit {1: }|
- {1:~ }type :help{5:<Enter>} for help {1: }|
+ {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
+ {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
+ {1:~ }type :q{18:<Enter>} to exit {1: }|
+ {1:~ }type :help{18:<Enter>} for help {1: }|
{1:~ }|
- {1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
+ {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
{1:~ }Help poor children in Uganda!{1: }|
- {1:~ }type :help iccf{5:<Enter>} for information {1: }|
+ {1:~ }type :help iccf{18:<Enter>} for information {1: }|
{1:~ }|*5
]]
- local showmode = { { '-- INSERT --', 3 } }
+ local showmode = { { '-- INSERT --', 5 } }
screen:expect(introscreen)
-- <c-l> (same as :mode) does _not_ clear intro message
@@ -1648,22 +1598,22 @@ describe('ui/ext_messages', function()
screen:expect {
grid = [[
^ |
- {1:~ }{8: }{1: }|
+ {1:~ }{4: }{1: }|
{1:~ }|*3
{MATCH:.*}|
{1:~ }|
{1:~ }Nvim is open source and freely distributable{1: }|
{1:~ }https://neovim.io/#chat{1: }|
{1:~ }|
- {1:~ }type :help nvim{5:<Enter>} if you are new! {1: }|
- {1:~ }type :checkhealth{5:<Enter>} to optimize Nvim{1: }|
- {1:~ }type :q{5:<Enter>} to exit {1: }|
- {1:~ }type :help{5:<Enter>} for help {1: }|
+ {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
+ {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
+ {1:~ }type :q{18:<Enter>} to exit {1: }|
+ {1:~ }type :help{18:<Enter>} for help {1: }|
{1:~ }|
- {1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
+ {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
{1:~ }Help poor children in Uganda!{1: }|
- {1:~ }type :help iccf{5:<Enter>} for information {1: }|
+ {1:~ }type :help iccf{18:<Enter>} for information {1: }|
{1:~ }|*5
]],
showmode = showmode,
@@ -1692,19 +1642,19 @@ describe('ui/ext_messages', function()
Nvim is open source and freely distributable |
https://neovim.io/#chat |
|
- type :help nvim{5:<Enter>} if you are new! |
- type :checkhealth{5:<Enter>} to optimize Nvim |
- type :q{5:<Enter>} to exit |
- type :help{5:<Enter>} for help |
+ type :help nvim{18:<Enter>} if you are new! |
+ type :checkhealth{18:<Enter>} to optimize Nvim |
+ type :q{18:<Enter>} to exit |
+ type :help{18:<Enter>} for help |
|
- {MATCH: +}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
+ {MATCH: +}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
|
Help poor children in Uganda! |
- type :help iccf{5:<Enter>} for information |
+ type :help iccf{18:<Enter>} for information |
|*5
]],
messages = {
- { content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' },
+ { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
},
}
@@ -1733,7 +1683,7 @@ describe('ui/ext_messages', function()
screen:expect {
grid = [[
|
- {1:~ }{8:^ }{1: }|
+ {1:~ }{4:^ }{1: }|
{1:~ }|*22
]],
}
@@ -1745,7 +1695,7 @@ describe('ui/ext_messages', function()
screen:expect {
grid = [[
|
- {1:~ }{8:^ }{1: }|
+ {1:~ }{4:^ }{1: }|
{1:~ }|*22
]],
}
@@ -1762,9 +1712,9 @@ describe('ui/ext_messages', function()
screen:expect {
grid = [[
|
- {1:~ }{8:^ }{1: }|
+ {1:~ }{4:^ }{1: }|
{1:~ }|*21
- {6:[No Name] }|
+ {2:[No Name] }|
]],
}
end)
@@ -1780,7 +1730,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────|
|
{1:~ }|*10
- {7:[No Name] }|
+ {3:[No Name] }|
]],
messages = {
{ content = { { ' cmdheight=0' } }, kind = '' },
@@ -1796,7 +1746,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────|
|
{1:~ }|*9
- {7:[No Name] }|
+ {3:[No Name] }|
]],
messages = {
{ content = { { ' laststatus=3' } }, kind = '' },
@@ -1816,7 +1766,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────|
|
{1:~ }|*10
- {7:[No Name] }|
+ {3:[No Name] }|
]],
messages = {
{ content = { { ' cmdheight=0' } }, kind = '' },
@@ -1829,13 +1779,6 @@ it('ui/ext_multigrid supports intro screen', function()
clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
local screen = Screen.new(80, 24)
screen:attach({ rgb = true, ext_multigrid = true })
- screen:set_default_attr_ids {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- }
screen:expect {
grid = [[
@@ -1850,15 +1793,15 @@ it('ui/ext_multigrid supports intro screen', function()
{1:~ }Nvim is open source and freely distributable{1: }|
{1:~ }https://neovim.io/#chat{1: }|
{1:~ }|
- {1:~ }type :help nvim{5:<Enter>} if you are new! {1: }|
- {1:~ }type :checkhealth{5:<Enter>} to optimize Nvim{1: }|
- {1:~ }type :q{5:<Enter>} to exit {1: }|
- {1:~ }type :help{5:<Enter>} for help {1: }|
+ {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
+ {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
+ {1:~ }type :q{18:<Enter>} to exit {1: }|
+ {1:~ }type :help{18:<Enter>} for help {1: }|
{1:~ }|
- {1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
+ {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
{1:~ }Help poor children in Uganda!{1: }|
- {1:~ }type :help iccf{5:<Enter>} for information {1: }|
+ {1:~ }type :help iccf{18:<Enter>} for information {1: }|
{1:~ }|*4
## grid 3
|
@@ -1886,7 +1829,7 @@ it('ui/ext_multigrid supports intro screen', function()
x^ |
{1:~ }|*22
## grid 3
- {3:-- INSERT --} |
+ {5:-- INSERT --} |
]],
win_viewport = {
[2] = {