Merge pull request #27980 from bfredl/noignore

refactor(tests): all screen tests should use highlights
This commit is contained in:
bfredl 2024-03-23 20:01:21 +01:00 committed by GitHub
commit 3d9c028a4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
40 changed files with 793 additions and 711 deletions

View File

@ -1744,12 +1744,11 @@ describe('api/buf', function()
api.nvim_buf_set_text(0, 0, 0, 1, 3, { 'XXX', 'YYY' }) api.nvim_buf_set_text(0, 0, 0, 1, 3, { 'XXX', 'YYY' })
screen:expect([[ screen:expect([[
XXX | XXX |
YYY | YYY |
^ | ^ |
~ | {1:~ }|
| |
]]) ]])
end) end)

View File

@ -460,7 +460,7 @@ describe('API/extmarks', function()
-- This shouldn't seg fault -- This shouldn't seg fault
screen:expect([[ screen:expect([[
12345^ 1 | 12345^ 1 |
~ |*8 {1:~ }|*8
| |
]]) ]])
end) end)
@ -513,7 +513,7 @@ describe('API/extmarks', function()
insert('abc') insert('abc')
screen:expect([[ screen:expect([[
ab^c12345 | ab^c12345 |
~ |*8 {1:~ }|*8
| |
]]) ]])
local rv = get_extmark_by_id(ns, marks[1]) local rv = get_extmark_by_id(ns, marks[1])
@ -1734,16 +1734,17 @@ describe('API/extmarks', function()
command('d2') command('d2')
screen:expect([[ screen:expect([[
S2^aaa bbb ccc | S2^aaa bbb ccc |
aaa bbb ccc |*3 {7: }aaa bbb ccc |*3
|*2 {7: } |
|
]]) ]])
-- mark is restored with undo_restore == true -- mark is restored with undo_restore == true
command('silent undo') command('silent undo')
screen:expect([[ screen:expect([[
S1 ^aaa bbb ccc | S1{7: }^aaa bbb ccc |
S1S2aaa bbb ccc | S1S2aaa bbb ccc |
S2 aaa bbb ccc | S2{7: }aaa bbb ccc |
aaa bbb ccc |*2 {7: }aaa bbb ccc |*2
| |
]]) ]])
-- decor is not removed twice -- decor is not removed twice
@ -1964,7 +1965,7 @@ describe('API/win_extmark', function()
grid = [[ grid = [[
non ui-watched line | non ui-watched line |
ui-watched lin^e | ui-watched lin^e |
~ | {1:~ }|
| |
]], ]],
extmarks = { extmarks = {
@ -2052,7 +2053,7 @@ describe('API/win_extmark', function()
grid = [[ grid = [[
ui-watched linupdat^e| ui-watched linupdat^e|
e | e |
~ | {1:~ }|
| |
]], ]],
extmarks = { extmarks = {
@ -2079,9 +2080,9 @@ describe('API/win_extmark', function()
grid = [[ grid = [[
## grid 1 ## grid 1
[4:--------------------]|*3 [4:--------------------]|*3
[No Name] [+] | {3:[No Name] [+] }|
[2:--------------------]|*2 [2:--------------------]|*2
[No Name] [+] | {2:[No Name] [+] }|
[3:--------------------]| [3:--------------------]|
## grid 2 ## grid 2
non ui-watched line | non ui-watched line |
@ -2091,7 +2092,7 @@ describe('API/win_extmark', function()
## grid 4 ## grid 4
non ui-watched line | non ui-watched line |
ui-watched lin^e | ui-watched lin^e |
~ | {1:~ }|
]], ]],
extmarks = { extmarks = {
[2] = { [2] = {
@ -2112,13 +2113,13 @@ describe('API/win_extmark', function()
grid = [[ grid = [[
## grid 1 ## grid 1
[4:--------------------]|*3 [4:--------------------]|*3
[No Name] [+] | {3:[No Name] [+] }|
[2:--------------------]|*2 [2:--------------------]|*2
[No Name] [+] | {2:[No Name] [+] }|
[3:--------------------]| [3:--------------------]|
## grid 2 ## grid 2
non ui-watched line | non ui-watched line |
ui-watched linupd@@@| ui-watched linupd{1:@@@}|
## grid 3 ## grid 3
| |
## grid 4 ## grid 4

View File

@ -1269,7 +1269,7 @@ describe('API', function()
api.nvim_paste('', true, 3) api.nvim_paste('', true, 3)
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
:Foo^ | :Foo^ |
]]) ]])
end) end)
@ -1280,8 +1280,8 @@ describe('API', function()
api.nvim_paste('normal! \023\022\006\027', true, -1) api.nvim_paste('normal! \023\022\006\027', true, -1)
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
:normal! ^W^V^F^[^ | :normal! {18:^W^V^F^[}^ |
]]) ]])
end) end)
it('crlf=false does not break lines at CR, CRLF', function() it('crlf=false does not break lines at CR, CRLF', function()
@ -1981,9 +1981,9 @@ describe('API', function()
-- Make any RPC request (can be non-async: op-pending does not block). -- Make any RPC request (can be non-async: op-pending does not block).
api.nvim_get_current_buf() api.nvim_get_current_buf()
screen:expect([[ screen:expect([[
^a$ | ^a{1:$} |
b$ | b{1:$} |
c$ | c{1:$} |
| |
]]) ]])
end) end)

View File

@ -1233,7 +1233,7 @@ describe('pty process teardown', function()
screen:attach() screen:attach()
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
| |
]]) ]])
end) end)

View File

@ -120,9 +120,9 @@ describe('command-line option', function()
feed('i:cq<CR>') feed('i:cq<CR>')
screen:expect([[ screen:expect([[
| |
[Process exited 1] | [Process exited 1]{2: } |
|*5 |*5
-- TERMINAL -- | {5:-- TERMINAL --} |
]]) ]])
--[=[ Example of incorrect output: --[=[ Example of incorrect output:
screen:expect([[ screen:expect([[

View File

@ -83,6 +83,8 @@ describe('startup', function()
local screen local screen
screen = Screen.new(60, 7) screen = Screen.new(60, 7)
screen:attach() screen:attach()
-- not the same colors on windows for some reason
screen._default_attr_ids = nil
local id = fn.termopen({ local id = fn.termopen({
nvim_prog, nvim_prog,
'-u', '-u',
@ -326,6 +328,9 @@ describe('startup', function()
local screen = Screen.new(25, 3) local screen = Screen.new(25, 3)
-- Remote UI connected by --embed. -- Remote UI connected by --embed.
screen:attach() screen:attach()
-- TODO: a lot of tests in this file already use the new default color scheme.
-- once we do the batch update of tests to use it, remove this workarond
screen._default_attr_ids = nil
command([[echo has('ttyin') has('ttyout')]]) command([[echo has('ttyin') has('ttyout')]])
screen:expect([[ screen:expect([[
^ | ^ |
@ -337,6 +342,7 @@ describe('startup', function()
it('in a TTY: has("ttyin")==1 has("ttyout")==1', function() it('in a TTY: has("ttyin")==1 has("ttyout")==1', function()
local screen = Screen.new(25, 4) local screen = Screen.new(25, 4)
screen:attach() screen:attach()
screen._default_attr_ids = nil
if is_os('win') then if is_os('win') then
command([[set shellcmdflag=/s\ /c shellxquote=\"]]) command([[set shellcmdflag=/s\ /c shellxquote=\"]])
end end
@ -428,6 +434,7 @@ describe('startup', function()
it('input from pipe (implicit) #7679', function() it('input from pipe (implicit) #7679', function()
local screen = Screen.new(25, 4) local screen = Screen.new(25, 4)
screen:attach() screen:attach()
screen._default_attr_ids = nil
if is_os('win') then if is_os('win') then
command([[set shellcmdflag=/s\ /c shellxquote=\"]]) command([[set shellcmdflag=/s\ /c shellxquote=\"]])
end end
@ -589,6 +596,7 @@ describe('startup', function()
local screen local screen
screen = Screen.new(60, 6) screen = Screen.new(60, 6)
screen:attach() screen:attach()
screen._default_attr_ids = nil
local id = fn.termopen({ local id = fn.termopen({
nvim_prog, nvim_prog,
'-u', '-u',
@ -1123,6 +1131,7 @@ describe('user config init', function()
local screen = Screen.new(50, 8) local screen = Screen.new(50, 8)
screen:attach() screen:attach()
screen._default_attr_ids = nil
fn.termopen({ nvim_prog }, { fn.termopen({ nvim_prog }, {
env = { env = {
VIMRUNTIME = os.getenv('VIMRUNTIME'), VIMRUNTIME = os.getenv('VIMRUNTIME'),

View File

@ -66,8 +66,8 @@ describe('CTRL-C (mapped)', function()
feed('i') feed('i')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
end) end)
@ -81,8 +81,8 @@ describe('CTRL-C (mapped)', function()
feed('i') feed('i')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
end) end)
end) end)

View File

@ -420,12 +420,12 @@ describe('named marks view', function()
feed("<C-w>p'a") feed("<C-w>p'a")
screen:expect([[ screen:expect([[
| |
~ |*3 {1:~ }|*3
[No Name] | {2:[No Name] }|
6 line | 6 line |
^7 line | ^7 line |
8 line | 8 line |
{MATCH:.*marks} | {3:<itor-marks }|
| |
]]) ]])
end) end)
@ -453,7 +453,7 @@ describe('named marks view', function()
command('bwipe!') command('bwipe!')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
| |
]]) ]])
command('rshada!') command('rshada!')

View File

@ -109,19 +109,19 @@ describe('Screen', function()
command('map <expr> x input("> ")') command('map <expr> x input("> ")')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]]) ]])
feed('x') feed('x')
screen:expect([[ screen:expect([[
| |
~ |*3 {1:~ }|*3
> ^ | > ^ |
]]) ]])
feed('\n') feed('\n')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
> | > |
]]) ]])
end) end)
@ -131,20 +131,20 @@ describe('Screen', function()
feed('i') feed('i')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('x') feed('x')
screen:expect([[ screen:expect([[
| |
~ |*3 {1:~ }|*3
> ^ | > ^ |
]]) ]])
feed('\n') feed('\n')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
end) end)
@ -153,7 +153,7 @@ describe('Screen', function()
feed(':<F2>') feed(':<F2>')
screen:expect([[ screen:expect([[
| |
~ |*3 {1:~ }|*3
:^ | :^ |
]]) ]])
end) end)
@ -181,7 +181,7 @@ describe('Screen', function()
one | one |
^two | ^two |
three | three |
[on] | {9:[on] }|
| |
]]) ]])
end) end)
@ -191,15 +191,16 @@ describe('Screen', function()
command('nmap <expr> <F2> execute("throw 42")') command('nmap <expr> <F2> execute("throw 42")')
feed('<F2>') feed('<F2>')
screen:expect([[ screen:expect([[
|*2 |
Error detected while processing : | {3: }|
E605: Exception not caught: 42 | {9:Error detected while processing :} |
Press ENTER or type command to continue^ | {9:E605: Exception not caught: 42} |
{6:Press ENTER or type command to continue}^ |
]]) ]])
feed('<CR>') feed('<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]]) ]])
end) end)
@ -210,32 +211,32 @@ describe('Screen', function()
feed(':echo "foo') feed(':echo "foo')
screen:expect([[ screen:expect([[
| |
~ |*3 {1:~ }|*3
:echo "foo^ | :echo "foo^ |
]]) ]])
feed('<F2>') feed('<F2>')
screen:expect([[ screen:expect([[
| {3: }|
:echo "foo | :echo "foo |
Error detected while processing : | {9:Error detected while processing :} |
E605: Exception not caught: 42 | {9:E605: Exception not caught: 42} |
:echo "foo^ | :echo "foo^ |
]]) ]])
feed('"') feed('"')
screen:expect([[ screen:expect([[
| {3: }|
:echo "foo | :echo "foo |
Error detected while processing : | {9:Error detected while processing :} |
E605: Exception not caught: 42 | {9:E605: Exception not caught: 42} |
:echo "foo"^ | :echo "foo"^ |
]]) ]])
feed('\n') feed('\n')
screen:expect([[ screen:expect([[
:echo "foo | :echo "foo |
Error detected while processing : | {9:Error detected while processing :} |
E605: Exception not caught: 42 | {9:E605: Exception not caught: 42} |
foo | foo |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
end) end)
@ -246,7 +247,7 @@ describe('Screen', function()
feed(': nmap a<CR>') feed(': nmap a<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
n a b | n a b |
]]) ]])
end) end)

View File

@ -38,6 +38,7 @@ describe(':oldfiles', function()
it('shows most recently used files', function() it('shows most recently used files', function()
local screen = Screen.new(100, 5) local screen = Screen.new(100, 5)
screen:attach() screen:attach()
screen._default_attr_ids = nil
feed_command('edit testfile1') feed_command('edit testfile1')
feed_command('edit testfile2') feed_command('edit testfile2')
feed_command('wshada') feed_command('wshada')

View File

@ -170,6 +170,7 @@ describe('swapfile detection', function()
set_session(nvim2) set_session(nvim2)
local screen2 = Screen.new(256, 40) local screen2 = Screen.new(256, 40)
screen2:attach() screen2:attach()
screen2._default_attr_ids = nil
exec(init) exec(init)
command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog). command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog).

View File

@ -50,7 +50,7 @@ describe('107', function()
[1, '1 '] | [1, '1 '] |
[50, '50 '] | [50, '50 '] |
^[59, '59 '] | ^[59, '59 '] |
~ |*9 {1:~ }|*9
3 more lines | 3 more lines |
]]) ]])
end) end)

View File

@ -24,26 +24,26 @@ describe('argument list commands', function()
feed(':confirm quit\n') feed(':confirm quit\n')
screen:expect([[ screen:expect([[
| |
~ | {1:~ }|
| {3: }|
:confirm quit | :confirm quit |
2 more files to edit. Quit anyway? | {6:2 more files to edit. Quit anyway?} |
[Y]es, (N)o: ^ | {6:[Y]es, (N)o: }^ |
]]) ]])
feed('N') feed('N')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
| |
]]) ]])
feed(':confirm quit\n') feed(':confirm quit\n')
screen:expect([[ screen:expect([[
| |
~ | {1:~ }|
| {3: }|
:confirm quit | :confirm quit |
2 more files to edit. Quit anyway? | {6:2 more files to edit. Quit anyway?} |
[Y]es, (N)o: ^ | {6:[Y]es, (N)o: }^ |
]]) ]])
expect_exit(1000, feed, 'Y') expect_exit(1000, feed, 'Y')
end) end)

View File

@ -93,8 +93,8 @@ describe('cmdline', function()
feed_command('DoSomething') feed_command('DoSomething')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
| {3: }|
Executing: DoSomething | Executing: DoSomething |
Executing: echo 'hello' |set ts=4 |let v = '123' |echo v | Executing: echo 'hello' |set ts=4 |let v = '123' |echo v |
hello | hello |
@ -102,7 +102,7 @@ describe('cmdline', function()
Executing: let v = '123' |echo v | Executing: let v = '123' |echo v |
Executing: echo v | Executing: echo v |
123 | 123 |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
end) end)

View File

@ -15,13 +15,13 @@ describe('cpoptions', function()
feed('c2w') feed('c2w')
screen:expect([[ screen:expect([[
^one tw$ three | ^one tw$ three |
~ |*4 {1:~ }|*4
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('vim<Esc>') feed('vim<Esc>')
screen:expect([[ screen:expect([[
vi^m three | vi^m three |
~ |*4 {1:~ }|*4
| |
]]) ]])
end) end)

View File

@ -149,7 +149,7 @@ describe('display', function()
]]) ]])
feed('736|') feed('736|')
screen:expect([[ screen:expect([[
<<<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {1:<<<}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*11 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*11
^aaaaaaaaaaaaaaa | ^aaaaaaaaaaaaaaa |
| |
@ -157,22 +157,22 @@ describe('display', function()
-- The correct part of the last line is moved into view. -- The correct part of the last line is moved into view.
feed('D') feed('D')
screen:expect([[ screen:expect([[
<<<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {1:<<<}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*10 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|*10
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^a| aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^a|
bbbbb bbbbb bbbbb bbbbb bbbbb bb@@@| bbbbb bbbbb bbbbb bbbbb bbbbb bb{1:@@@}|
| |
]]) ]])
-- "w_skipcol" does not change because the topline is still long enough -- "w_skipcol" does not change because the topline is still long enough
-- to maintain the current skipcol. -- to maintain the current skipcol.
feed('g04l11gkD') feed('g04l11gkD')
screen:expect([[ screen:expect([[
<<<^a | {1:<<<}^a |
bbbbb bbbbb bbbbb bbbbb bbbbb bbbbb| bbbbb bbbbb bbbbb bbbbb bbbbb bbbbb|
bbbbb ccccc ccccc ccccc ccccc cccc| bbbbb ccccc ccccc ccccc ccccc cccc|
c ccccc ccccc ddddd ddddd ddddd ddd| c ccccc ccccc ddddd ddddd ddddd ddd|
dd ddddd ddddd ddddd | dd ddddd ddddd ddddd |
~ |*8 {1:~ }|*8
| |
]]) ]])
-- "w_skipcol" is reset to bring the entire topline into view because -- "w_skipcol" is reset to bring the entire topline into view because
@ -183,7 +183,7 @@ describe('display', function()
aa^a | aa^a |
bbbbb bbbbb bbbbb bbbbb bbbbb bbbbb| bbbbb bbbbb bbbbb bbbbb bbbbb bbbbb|
bbbbb ccccc ccccc ccccc ccccc cccc| bbbbb ccccc ccccc ccccc ccccc cccc|
c ccccc ccccc ddddd ddddd ddddd @@@| c ccccc ccccc ddddd ddddd ddddd {1:@@@}|
| |
]]) ]])
end) end)
@ -197,7 +197,7 @@ describe('display', function()
norm $j norm $j
]]) ]])
screen:expect([[ screen:expect([[
<<<bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb| {1:<<<}bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*5 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*5
b^b | b^b |
| |
@ -207,7 +207,7 @@ describe('display', function()
exec('set number cpo+=n scrolloff=0') exec('set number cpo+=n scrolloff=0')
feed('$0') feed('$0')
screen:expect([[ screen:expect([[
<<<b^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb| {1:<<<}b^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6
| |
]]) ]])
@ -215,14 +215,14 @@ describe('display', function()
exec('set smoothscroll') exec('set smoothscroll')
feed('$b') feed('$b')
screen:expect([[ screen:expect([[
2 b ^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb| {8: 2 }b ^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6
| |
]]) ]])
-- Same for "ge". -- Same for "ge".
feed('$ge') feed('$ge')
screen:expect([[ screen:expect([[
2 ^b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb| {8: 2 }^b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*6
| |
]]) ]])

View File

@ -22,15 +22,15 @@ describe(':highlight', function()
-- is discarded resulting in test failure -- is discarded resulting in test failure
screen:expect([[ screen:expect([[
:highlight | :highlight |
SpecialKey xxx ctermfg=4 | SpecialKey {18:xxx} {18:ctermfg=}4 |
guifg=Blue | {18:guifg=}Blue |
EndOfBuffer xxx links to NonText| EndOfBuffer {1:xxx} {18:links to} NonText|
| |
TermCursor xxx cterm=reverse | TermCursor {2:xxx} {18:cterm=}reverse |
gui=reverse | {18:gui=}reverse |
TermCursorNC xxx cleared | TermCursorNC xxx cleared |
NonText xxx ctermfg=12 | NonText {1:xxx} {18:ctermfg=}12 |
-- More --^ | {6:-- More --}^ |
]]) ]])
feed('q') feed('q')
poke_eventloop() -- wait until we're back to normal poke_eventloop() -- wait until we're back to normal

View File

@ -66,11 +66,11 @@ describe('set', function()
command('verbose set scroll?') command('verbose set scroll?')
screen:expect([[ screen:expect([[
| |
~ |*11 {1:~ }|*11
| {3: }|
scroll=7 | scroll=7 |
Last set from changed window size | Last set from changed window size |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
end) end)

View File

@ -58,11 +58,11 @@ describe('prompt buffer', function()
]]) ]])
screen:expect([[ screen:expect([[
cmd: ^ | cmd: ^ |
~ |*3 {1:~ }|*3
[Prompt] [+] | {3:[Prompt] [+] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
end end
@ -79,15 +79,15 @@ describe('prompt buffer', function()
Command: "hello" | Command: "hello" |
Result: "hello" | Result: "hello" |
cmd: ^ | cmd: ^ |
[Prompt] | {3:[Prompt] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('exit\n') feed('exit\n')
screen:expect([[ screen:expect([[
^other buffer | ^other buffer |
~ |*8 {1:~ }|*8
| |
]]) ]])
end) end)
@ -98,43 +98,43 @@ describe('prompt buffer', function()
feed('hello<BS><BS>') feed('hello<BS><BS>')
screen:expect([[ screen:expect([[
cmd: hel^ | cmd: hel^ |
~ |*3 {1:~ }|*3
[Prompt] [+] | {3:[Prompt] [+] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('<Left><Left><Left><BS>-') feed('<Left><Left><Left><BS>-')
screen:expect([[ screen:expect([[
cmd: -^hel | cmd: -^hel |
~ |*3 {1:~ }|*3
[Prompt] [+] | {3:[Prompt] [+] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('<C-O>lz') feed('<C-O>lz')
screen:expect([[ screen:expect([[
cmd: -hz^el | cmd: -hz^el |
~ |*3 {1:~ }|*3
[Prompt] [+] | {3:[Prompt] [+] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('<End>x') feed('<End>x')
screen:expect([[ screen:expect([[
cmd: -hzelx^ | cmd: -hzelx^ |
~ |*3 {1:~ }|*3
[Prompt] [+] | {3:[Prompt] [+] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('<C-U>exit\n') feed('<C-U>exit\n')
screen:expect([[ screen:expect([[
^other buffer | ^other buffer |
~ |*8 {1:~ }|*8
| |
]]) ]])
end) end)
@ -143,32 +143,30 @@ describe('prompt buffer', function()
it('switch windows', function() it('switch windows', function()
source_script() source_script()
feed('<C-O>:call SwitchWindows()<CR>') feed('<C-O>:call SwitchWindows()<CR>')
screen:expect { screen:expect([[
grid = [[
cmd: | cmd: |
~ |*3 {1:~ }|*3
[Prompt] [+] | {2:[Prompt] [+] }|
^other buffer | ^other buffer |
~ |*3 {1:~ }|*3
| |
]], ]])
}
feed('<C-O>:call SwitchWindows()<CR>') feed('<C-O>:call SwitchWindows()<CR>')
screen:expect([[ screen:expect([[
cmd: ^ | cmd: ^ |
~ |*3 {1:~ }|*3
[Prompt] [+] | {3:[Prompt] [+] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
feed('<Esc>') feed('<Esc>')
screen:expect([[ screen:expect([[
cmd:^ | cmd:^ |
~ |*3 {1:~ }|*3
[Prompt] [+] | {3:[Prompt] [+] }|
other buffer | other buffer |
~ |*3 {1:~ }|*3
| |
]]) ]])
end) end)

View File

@ -66,8 +66,8 @@ describe('put', function()
three more text three more text | three more text three more text |
^four more text four more text | ^four more text four more text |
| |
~ ~ |*2 {1:~ }{1:~ }|*2
[No Name] [+] [No Name] [+] | {3:[No Name] [+] }{2:[No Name] [+] }|
| |
]]) ]])
end) end)

View File

@ -23,9 +23,9 @@ describe('smoothscroll', function()
set number set number
]]) ]])
feed('<C-Y>') feed('<C-Y>')
screen:expect({ any = ' 1 ^one' }) screen:expect({ any = '{8: 1 }^one' })
feed('<C-E><C-E><C-E>') feed('<C-E><C-E><C-E>')
screen:expect({ any = ' 2 ^two' }) screen:expect({ any = '{8: 2 }^two' })
end) end)
-- oldtest: Test_smoothscroll_CtrlE_CtrlY() -- oldtest: Test_smoothscroll_CtrlE_CtrlY()
@ -43,28 +43,28 @@ describe('smoothscroll', function()
long word long word long word | long word long word long word |
^line | ^line |
line |*2 line |*2
~ |*2 {1:~ }|*2
| |
]] ]]
local s2 = [[ local s2 = [[
<<<d word word word word word word word | {1:<<<}d word word word word word word word |
word word word word | word word word word |
line three | line three |
long word long word long word long word | long word long word long word long word |
long word long word long word | long word long word long word |
^line | ^line |
line |*2 line |*2
~ |*3 {1:~ }|*3
| |
]] ]]
local s3 = [[ local s3 = [[
<<<d word word word | {1:<<<}d word word word |
line three | line three |
long word long word long word long word | long word long word long word long word |
long word long word long word | long word long word long word |
^line | ^line |
line |*2 line |*2
~ |*4 {1:~ }|*4
| |
]] ]]
local s4 = [[ local s4 = [[
@ -73,28 +73,28 @@ describe('smoothscroll', function()
long word long word long word | long word long word long word |
line |*2 line |*2
^line | ^line |
~ |*5 {1:~ }|*5
| |
]] ]]
local s5 = [[ local s5 = [[
<<<d word word word | {1:<<<}d word word word |
line three | line three |
long word long word long word long word | long word long word long word long word |
long word long word long word | long word long word long word |
line |*2 line |*2
^line | ^line |
~ |*4 {1:~ }|*4
| |
]] ]]
local s6 = [[ local s6 = [[
<<<d word word word word word word word | {1:<<<}d word word word word word word word |
word word word word | word word word word |
line three | line three |
long word long word long word long word | long word long word long word long word |
long word long word long word | long word long word long word |
line |*2 line |*2
^line | ^line |
~ |*3 {1:~ }|*3
| |
]] ]]
local s7 = [[ local s7 = [[
@ -105,7 +105,7 @@ describe('smoothscroll', function()
long word long word long word | long word long word long word |
line |*2 line |*2
^line | ^line |
~ |*2 {1:~ }|*2
| |
]] ]]
local s8 = [[ local s8 = [[
@ -117,7 +117,7 @@ describe('smoothscroll', function()
long word long word long word | long word long word long word |
line |*2 line |*2
^line | ^line |
~ | {1:~ }|
| |
]] ]]
feed('<C-E>') feed('<C-E>')
@ -160,7 +160,7 @@ describe('smoothscroll', function()
ϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛ^ϛϛϛϛϛ| ϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛϛ^ϛϛϛϛϛ|
ϛϛϛϛϛ | ϛϛϛϛϛ |
222222222222222222222222222222222222 | 222222222222222222222222222222222222 |
~ |*2 {1:~ }|*2
| |
]]) ]])
end) end)
@ -181,134 +181,136 @@ describe('smoothscroll', function()
endfunc endfunc
]]) ]])
screen:expect([[ screen:expect([[
1 one word word word word word word wo| {8: 1 }one word word word word word word wo|
rd word word word word word word word wo| rd word word word word word word word wo|
rd word word word word word | rd word word word word word |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long word | ng word long word long word long word |
3 ^line | {8: 3 }^line |
4 line | {8: 4 }line |
5 line | {8: 5 }line |
~ |*3 {1:~ }|*3
| |
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
<<<word word word word word word word wo| {1:<<<}word word word word word word word wo|
rd word word word word word | rd word word word word word |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long word | ng word long word long word long word |
3 ^line | {8: 3 }^line |
4 line | {8: 4 }line |
5 line | {8: 5 }line |
~ |*4 {1:~ }|*4
| |
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
<<<word word word word word | {1:<<<}word word word word word |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long word | ng word long word long word long word |
3 ^line | {8: 3 }^line |
4 line | {8: 4 }line |
5 line | {8: 5 }line |
~ |*5 {1:~ }|*5
| |
]]) ]])
exec('set cpo-=n') exec('set cpo-=n')
screen:expect([[ screen:expect([[
<<< d word word word word word word | {1:<<<}{8: }d word word word word word word |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long wor| {8: }ng word long word long word long wor|
d | {8: }d |
3 ^line | {8: 3 }^line |
4 line | {8: 4 }line |
5 line | {8: 5 }line |
~ |*4 {1:~ }|*4
| |
]]) ]])
feed('<C-Y>') feed('<C-Y>')
screen:expect([[ screen:expect([[
<<< rd word word word word word word wor| {1:<<<}{8: }rd word word word word word word wor|
d word word word word word word | {8: }d word word word word word word |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long wor| {8: }ng word long word long word long wor|
d | {8: }d |
3 ^line | {8: 3 }^line |
4 line | {8: 4 }line |
5 line | {8: 5 }line |
~ |*3 {1:~ }|*3
| |
]]) ]])
feed('<C-Y>') feed('<C-Y>')
screen:expect([[ screen:expect([[
1 one word word word word word word wo| {8: 1 }one word word word word word word wo|
rd word word word word word word wor| {8: }rd word word word word word word wor|
d word word word word word word | {8: }d word word word word word word |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long wor| {8: }ng word long word long word long wor|
d | {8: }d |
3 ^line | {8: 3 }^line |
4 line | {8: 4 }line |
5 line | {8: 5 }line |
~ |*2 {1:~ }|*2
| |
]]) ]])
exec('botright split') exec('botright split')
feed('gg') feed('gg')
screen:expect([[ screen:expect([[
1 one word word word word word word wo| {8: 1 }one word word word word word word wo|
rd word word word word word word wor| {8: }rd word word word word word word wor|
d word word word word word word | {8: }d word word word word word word |
2 two long word long word long word@@@| {8: 2 }two long word long word long word{1:@@@}|
[No Name] [+] | {2:[No Name] [+] }|
1 ^one word word word word word word wo| {8: 1 }^one word word word word word word wo|
rd word word word word word word wor| {8: }rd word word word word word word wor|
d word word word word word word | {8: }d word word word word word word |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long @@@| {8: }ng word long word long word long {1:@@@}|
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
1 one word word word word word word wo| {8: 1 }one word word word word word word wo|
rd word word word word word word wor| {8: }rd word word word word word word wor|
d word word word word word word | {8: }d word word word word word word |
2 two long word long word long word@@@| {8: 2 }two long word long word long word{1:@@@}|
[No Name] [+] | {2:[No Name] [+] }|
<<< rd word word word word word word wor| {1:<<<}{8: }rd word word word word word word wor|
d word word word word word word^ | {8: }d word word word word word word^ |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long wor| {8: }ng word long word long word long wor|
d | {8: }d |
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
1 one word word word word word word wo| {8: 1 }one word word word word word word wo|
rd word word word word word word wor| {8: }rd word word word word word word wor|
d word word word word word word | {8: }d word word word word word word |
2 two long word long word long word@@@| {8: 2 }two long word long word long word{1:@@@}|
[No Name] [+] | {2:[No Name] [+] }|
<<< d word word word word word word^ | {1:<<<}{8: }d word word word word word word^ |
2 two long word long word long word lo| {8: 2 }two long word long word long word lo|
ng word long word long word long wor| {8: }ng word long word long word long wor|
d | {8: }d |
3 line | {8: 3 }line |
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
exec('close') exec('close')
exec('call DoRel()') exec('call DoRel()')
screen:expect([[ screen:expect([[
2<<<^ong text very long text very long te| {8:2}{1:<<<}^ong text very long text very long te|
xt very long text very long text ver| {8: }xt very long text very long text ver|
y long text very long text very long| {8: }y long text very long text very long|
text very long text very long text | {8: } text very long text very long text |
1 three | {8: 1 }three |
~ |*6 {1:~ }|*6
--No lines in buffer-- | --No lines in buffer-- |
]]) ]])
end) end)
@ -323,22 +325,22 @@ describe('smoothscroll', function()
exe "normal 2Gzt\<C-E>" exe "normal 2Gzt\<C-E>"
]]) ]])
screen:expect([[ screen:expect([[
<<<t very long text very long text very | {1:<<<}t very long text very long text very |
^long text very long text very long text | ^long text very long text very long text |
very long text very long text very long | very long text very long text very long |
text very long text- | text very long text{1:-} |
three | three |
~ |*2 {1:~ }|*2
| |
]]) ]])
exec('set listchars+=precedes:#') exec('set listchars+=precedes:#')
screen:expect([[ screen:expect([[
#ext very long text very long text very | {1:#}ext very long text very long text very |
^long text very long text very long text | ^long text very long text very long text |
very long text very long text very long | very long text very long text very long |
text very long text- | text very long text{1:-} |
three | three |
~ |*2 {1:~ }|*2
| |
]]) ]])
end) end)
@ -356,13 +358,14 @@ describe('smoothscroll', function()
set smoothscroll set smoothscroll
diffthis diffthis
]]) ]])
screen:expect([[ screen:expect([[
- ^just some text here | {7:- }^just some text here |
~ |*2 {1:~ }|*2
[No Name] [+] | {3:[No Name] [+] }|
- just some text here | {7:- }just some text here |
~ | {1:~ }|
[No Name] [+] | {2:[No Name] [+] }|
| |
]]) ]])
feed('<C-Y>') feed('<C-Y>')
@ -380,7 +383,7 @@ describe('smoothscroll', function()
:3 :3
]]) ]])
screen:expect([[ screen:expect([[
<<<h some text with some text | {1:<<<}h some text with some text |
Line with some text with some text with | Line with some text with some text with |
some text with some text with some text | some text with some text with some text |
with some text with some text | with some text with some text |
@ -401,7 +404,7 @@ describe('smoothscroll', function()
-- moving cursor up right after the <<< marker - no need to show whole line -- moving cursor up right after the <<< marker - no need to show whole line
feed('2gj3l2k') feed('2gj3l2k')
screen:expect([[ screen:expect([[
<<<^h some text with some text | {1:<<<}^h some text with some text |
Line with some text with some text with | Line with some text with some text with |
some text with some text with some text | some text with some text with some text |
with some text with some text | with some text with some text |
@ -419,7 +422,7 @@ describe('smoothscroll', function()
Line with some text with some text with | Line with some text with some text with |
some text with some text with some text | some text with some text with some text |
with some text with some text | with some text with some text |
@ | {1:@ }|
| |
]]) ]])
end) end)
@ -443,7 +446,7 @@ describe('smoothscroll', function()
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
<<<th lot^s of text with lots of text wit| {1:<<<}th lot^s of text with lots of text wit|
h lots of text with lots of text with lo| h lots of text with lots of text with lo|
ts of text with lots of text with lots o| ts of text with lots of text with lots o|
f text with lots of text with lots of te| f text with lots of text with lots of te|
@ -452,7 +455,7 @@ describe('smoothscroll', function()
]]) ]])
feed('5<C-E>') feed('5<C-E>')
screen:expect([[ screen:expect([[
<<< lots ^of text with lots of text with | {1:<<<} lots ^of text with lots of text with |
lots of text with lots of text with lots| lots of text with lots of text with lots|
of text with lots of text with lots of | of text with lots of text with lots of |
text with lots of text with lots of text| text with lots of text with lots of text|
@ -462,7 +465,7 @@ describe('smoothscroll', function()
-- scrolling down, cursor moves screen line up -- scrolling down, cursor moves screen line up
feed('5<C-Y>') feed('5<C-Y>')
screen:expect([[ screen:expect([[
<<<th lots of text with lots of text wit| {1:<<<}th lots of text with lots of text wit|
h lots of text with lots of text with lo| h lots of text with lots of text with lo|
ts of text with lots of text with lots o| ts of text with lots of text with lots o|
f text with lots of text with lots of te| f text with lots of text with lots of te|
@ -482,7 +485,7 @@ describe('smoothscroll', function()
exec('set scrolloff=1') exec('set scrolloff=1')
feed('10|<C-E>') feed('10|<C-E>')
screen:expect([[ screen:expect([[
<<<th lots of text with lots of text wit| {1:<<<}th lots of text with lots of text wit|
h lots of^ text with lots of text with lo| h lots of^ text with lots of text with lo|
ts of text with lots of text with lots o| ts of text with lots of text with lots o|
f text with lots of text with lots of te| f text with lots of text with lots of te|
@ -492,7 +495,7 @@ describe('smoothscroll', function()
-- 'scrolloff' set to 1, scrolling down, cursor moves screen line up -- 'scrolloff' set to 1, scrolling down, cursor moves screen line up
feed('<C-E>gjgj<C-Y>') feed('<C-E>gjgj<C-Y>')
screen:expect([[ screen:expect([[
<<<th lots of text with lots of text wit| {1:<<<}th lots of text with lots of text wit|
h lots of text with lots of text with lo| h lots of text with lots of text with lo|
ts of text with lots of text with lots o| ts of text with lots of text with lots o|
f text wi^th lots of text with lots of te| f text wi^th lots of text with lots of te|
@ -503,7 +506,7 @@ describe('smoothscroll', function()
exec('set scrolloff=2') exec('set scrolloff=2')
feed('10|<C-E>') feed('10|<C-E>')
screen:expect([[ screen:expect([[
<<<th lots of text with lots of text wit| {1:<<<}th lots of text with lots of text wit|
h lots of text with lots of text with lo| h lots of text with lots of text with lo|
ts of tex^t with lots of text with lots o| ts of tex^t with lots of text with lots o|
f text with lots of text with lots of te| f text with lots of text with lots of te|
@ -518,7 +521,7 @@ describe('smoothscroll', function()
exec('set scrolloff=0') exec('set scrolloff=0')
feed('0j') feed('0j')
screen:expect([[ screen:expect([[
<<<th lots of text with lots of text wit| {1:<<<}th lots of text with lots of text wit|
h lots of text with lots of text with lo| h lots of text with lots of text with lo|
ts of text with lots of text with lots o| ts of text with lots of text with lots o|
f text with lots of text end | f text with lots of text end |
@ -529,20 +532,20 @@ describe('smoothscroll', function()
feed('zt') feed('zt')
screen:expect([[ screen:expect([[
^four | ^four |
~ |*4 {1:~ }|*4
| |
]]) ]])
feed('zz') feed('zz')
screen:expect([[ screen:expect([[
<<<of text with lots of text with lots o| {1:<<<}of text with lots of text with lots o|
f text with lots of text end | f text with lots of text end |
^four | ^four |
~ |*2 {1:~ }|*2
| |
]]) ]])
feed('zb') feed('zb')
screen:expect([[ screen:expect([[
<<<th lots of text with lots of text wit| {1:<<<}th lots of text with lots of text wit|
h lots of text with lots of text with lo| h lots of text with lots of text with lo|
ts of text with lots of text with lots o| ts of text with lots of text with lots o|
f text with lots of text end | f text with lots of text end |
@ -567,7 +570,7 @@ describe('smoothscroll', function()
-- screen. -- screen.
feed('3Gzt<C-E>j') feed('3Gzt<C-E>j')
screen:expect([[ screen:expect([[
<<<th lots of text with lots of text wit| {1:<<<}th lots of text with lots of text wit|
h lots of text with lots of text with lo| h lots of text with lots of text with lo|
ts of text with lots of text with lots o| ts of text with lots of text with lots o|
f text with lots of text end | f text with lots of text end |
@ -588,16 +591,16 @@ describe('smoothscroll', function()
lots of text with lots of text with lot| lots of text with lots of text with lot|
s of text with lots of text with lots of| s of text with lots of text with lots of|
text | text |
~ | {1:~ }|
| |
]] ]]
screen:expect(s1) screen:expect(s1)
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
<<<ts of text with lots of text with lot| {1:<<<}ts of text with lots of text with lot|
^s of text with lots of text with lots of| ^s of text with lots of text with lots of|
text | text |
~ |*2 {1:~ }|*2
| |
]]) ]])
feed('0') feed('0')
@ -612,20 +615,20 @@ describe('smoothscroll', function()
exec('set smoothscroll scrolloff=0 showbreak=+++\\ ') exec('set smoothscroll scrolloff=0 showbreak=+++\\ ')
local s1 = [[ local s1 = [[
^with lots of text in one line with lots | ^with lots of text in one line with lots |
+++ of text in one line with lots of tex| {1:+++ }of text in one line with lots of tex|
+++ t in one line with lots of text in o| {1:+++ }t in one line with lots of text in o|
+++ ne line with lots of text in one lin| {1:+++ }ne line with lots of text in one lin|
+++ e with lots of text in one line | {1:+++ }e with lots of text in one line |
| |
]] ]]
screen:expect(s1) screen:expect(s1)
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
+++ ^of text in one line with lots of tex| {1:+++ }^of text in one line with lots of tex|
+++ t in one line with lots of text in o| {1:+++ }t in one line with lots of text in o|
+++ ne line with lots of text in one lin| {1:+++ }ne line with lots of text in one lin|
+++ e with lots of text in one line | {1:+++ }e with lots of text in one line |
~ | {1:~ }|
| |
]]) ]])
feed('0') feed('0')
@ -642,13 +645,13 @@ describe('smoothscroll', function()
screen:expect([[ screen:expect([[
^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| ^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
| |
~ |*3 {1:~ }|*3
| |
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
<<< ^ | {1:<<<} ^ |
~ |*4 {1:~ }|*4
| |
]]) ]])
end) end)
@ -694,7 +697,7 @@ describe('smoothscroll', function()
]=]) ]=])
feed('<C-E>gjgk') feed('<C-E>gjgk')
screen:expect([[ screen:expect([[
<<<lots of text in one line^ | {1:<<<}lots of text in one line^ |
line two | line two |
line three | line three |
line four | line four |
@ -717,7 +720,7 @@ describe('smoothscroll', function()
call search('xxx') call search('xxx')
]=]) ]=])
screen:expect([[ screen:expect([[
<<<_____________________________________| {1:<<<}_____________________________________|
________________________________________| ________________________________________|
______________________________________^xx| ______________________________________^xx|
x______________________________________x| x______________________________________x|
@ -744,7 +747,7 @@ describe('smoothscroll', function()
feed('<C-B>G') feed('<C-B>G')
-- cursor is not placed below window -- cursor is not placed below window
screen:expect([[ screen:expect([[
<<<aaaaaaaaaaaaaaaaa | {1:<<<}aaaaaaaaaaaaaaaaa |
|*7 |*7
^ | ^ |
| |
@ -901,15 +904,15 @@ describe('smoothscroll', function()
]]) ]])
screen:expect([[ screen:expect([[
| |
[No Name] | {2:[No Name] }|
line1 | line1 |
line2 | line2 |
^line3line3line3line3line3line3line3line3| ^line3line3line3line3line3line3line3line3|
line3line3line3line3line3line3line3line3| line3line3line3line3line3line3line3line3|
line3line3line3line3 | line3line3line3line3 |
line4 | line4 |
~ |*2 {1:~ }|*2
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
end) end)
@ -952,7 +955,7 @@ describe('smoothscroll', function()
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
<<<e text with some text with some text with some text | {1:<<<}e text with some text with some text with some text |
virt_below1 | virt_below1 |
virt_above1 | virt_above1 |
^Line with some text with some text with some text with | ^Line with some text with some text with some text with |
@ -977,7 +980,7 @@ describe('smoothscroll', function()
some text with some text with some text with some text | some text with some text with some text with some text |
virt_below2 | virt_below2 |
virt_above2 | virt_above2 |
Line with some text with some text with some text wi@@@| Line with some text with some text with some text wi{1:@@@}|
| |
]]) ]])
feed('<C-E>') feed('<C-E>')
@ -992,12 +995,12 @@ describe('smoothscroll', function()
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
<<<e text with some text with some text with some tex^t | {1:<<<}e text with some text with some text with some tex^t |
virt_below2 | virt_below2 |
virt_above2 | virt_above2 |
Line with some text with some text with some text with | Line with some text with some text with some text with |
some text with some text with some text with some text | some text with some text with some text with some text |
~ | {1:~ }|
| |
]]) ]])
end) end)
@ -1010,65 +1013,73 @@ describe('smoothscroll', function()
]]) ]])
feed('Go123456789<CR>') feed('Go123456789<CR>')
screen:expect([[ screen:expect([[
<<<ery long line ...A very long line ...| {1:<<<}ery long line ...A very long line ...|
A very long line ...A very long line ...|*5 A very long line ...A very long line ...|*5
123456789 | 123456789 |
^ | ^ |
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
end) end)
it('<<< marker shows with tabline, winbar and splits', function() it('<<< marker shows with tabline, winbar and splits', function()
screen:try_resize(40, 12) screen:try_resize(40, 12)
screen:set_default_attr_ids({
[1] = { foreground = Screen.colors.Blue1, bold = true },
[2] = { reverse = true },
[3] = { bold = true, reverse = true },
[4] = { background = Screen.colors.LightMagenta },
[5] = { bold = true },
[31] = { foreground = Screen.colors.Fuchsia, bold = true },
})
exec([[ exec([[
call setline(1, ['Line' .. (' with some text'->repeat(7))]->repeat(7)) call setline(1, ['Line' .. (' with some text'->repeat(7))]->repeat(7))
set smoothscroll scrolloff=0 set smoothscroll scrolloff=0
norm sj norm sj
]]) ]])
screen:expect([[ screen:expect([[
<<<e text with some text with some text | {1:<<<}e text with some text with some text |
with some text with some text | with some text with some text |
Line with some text with some text with | Line with some text with some text with |
some text with some text with some text | some text with some text with some text |
with some text with some text | with some text with some text |
[No Name] [+] | {2:[No Name] [+] }|
<<<e text with some text with some text | {1:<<<}e text with some text with some text |
^with some text with some text | ^with some text with some text |
Line with some text with some text with | Line with some text with some text with |
some text with some text with some te@@@| some text with some text with some te{1:@@@}|
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
exec('set showtabline=2') exec('set showtabline=2')
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
2+ [No Name] | {5: }{31:2}{5:+ [No Name] }{2: }|
<<<e text with some text with some text | {1:<<<}e text with some text with some text |
with some text with some text | with some text with some text |
Line with some text with some text with | Line with some text with some text with |
some text with some text with some text | some text with some text with some text |
with some text with some text | with some text with some text |
[No Name] [+] | {2:[No Name] [+] }|
<<<e text with some text with some text | {1:<<<}e text with some text with some text |
^with some text with some text | ^with some text with some text |
Line with some text with some text wi@@@| Line with some text with some text wi{1:@@@}|
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
exec('set winbar=winbar') exec('set winbar=winbar')
feed('<C-w>k<C-E>') feed('<C-w>k<C-E>')
screen:expect([[ screen:expect([[
2+ [No Name] | {5: }{31:2}{5:+ [No Name] }{2: }|
winbar | {5:winbar }|
<<<e text with some text with some text | {1:<<<}e text with some text with some text |
^with some text with some text | ^with some text with some text |
Line with some text with some text with | Line with some text with some text with |
some text with some text with some te@@@| some text with some text with some te{1:@@@}|
[No Name] [+] | {3:[No Name] [+] }|
winbar | {5:winbar }|
<<<e text with some text with some text | {1:<<<}e text with some text with some text |
with some text with some text | with some text with some text |
[No Name] [+] | {2:[No Name] [+] }|
| |
]]) ]])
end) end)

View File

@ -65,10 +65,10 @@ describe('splitkeep', function()
99 | 99 |
^100 | ^100 |
101 | 101 |
[No Name] [+] | {3:[No Name] [+] }|
5 | 5 |
6 | 6 |
[No Name] [+] | {2:[No Name] [+] }|
| |
]]) ]])
@ -77,10 +77,10 @@ describe('splitkeep', function()
100 | 100 |
^101 | ^101 |
102 | 102 |
[No Name] [+] | {3:[No Name] [+] }|
5 | 5 |
6 | 6 |
[No Name] [+] | {2:[No Name] [+] }|
| |
]]) ]])
@ -90,10 +90,10 @@ describe('splitkeep', function()
198 | 198 |
199 | 199 |
^200 | ^200 |
[No Name] [+] | {3:[No Name] [+] }|
5 | 5 |
6 | 6 |
[No Name] [+] | {2:[No Name] [+] }|
| |
]]) ]])
end) end)
@ -135,13 +135,13 @@ describe('splitkeep', function()
3 | 3 |
4 | 4 |
5 | 5 |
[No Name] [+] | {2:[No Name] [+] }|
^7 | ^7 |
8 | 8 |
9 | 9 |
10 | 10 |
11 | 11 |
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
feed(':quit<CR>Ht') feed(':quit<CR>Ht')
@ -152,13 +152,13 @@ describe('splitkeep', function()
3 | 3 |
4 | 4 |
5 | 5 |
[No Name] [+] | {3:[No Name] [+] }|
7 | 7 |
8 | 8 |
9 | 9 |
10 | 10 |
11 | 11 |
[No Name] [+] | {2:[No Name] [+] }|
:quit | :quit |
]]) ]])
feed(':set sb<CR>:quit<CR>Gj') feed(':set sb<CR>:quit<CR>Gj')
@ -168,14 +168,14 @@ describe('splitkeep', function()
3 | 3 |
4 | 4 |
^5 | ^5 |
[No Name] [+] | {3:[No Name] [+] }|
7 | 7 |
8 | 8 |
9 | 9 |
10 | 10 |
11 | 11 |
12 | 12 |
[No Name] [+] | {2:[No Name] [+] }|
:quit | :quit |
]]) ]])
feed(':quit<CR>Gt') feed(':quit<CR>Gt')
@ -185,14 +185,14 @@ describe('splitkeep', function()
3 | 3 |
4 | 4 |
5 | 5 |
[No Name] [+] | {2:[No Name] [+] }|
7 | 7 |
8 | 8 |
9 | 9 |
10 | 10 |
11 | 11 |
^12 | ^12 |
[No Name] [+] | {3:[No Name] [+] }|
:quit | :quit |
]]) ]])
end) end)
@ -213,70 +213,70 @@ describe('splitkeep', function()
]]) ]])
feed('L:wincmd s<CR>') feed('L:wincmd s<CR>')
screen:expect([[ screen:expect([[
1 +-- 7 lines: int FuncName() {···················| {8: 1 }{13:+-- 7 lines: int FuncName() {···················}|
8 after fold | {8: 8 }after fold |
9 +-- 7 lines: int FuncName() {···················| {8: 9 }{13:+-- 7 lines: int FuncName() {···················}|
16 after fold | {8: 16 }after fold |
17 +-- 7 lines: int FuncName() {···················| {8: 17 }{13:+-- 7 lines: int FuncName() {···················}|
24 ^after fold | {8: 24 }^after fold |
[No Name] [+] | {3:[No Name] [+] }|
32 after fold | {8: 32 }after fold |
33 +-- 7 lines: int FuncName() {···················| {8: 33 }{13:+-- 7 lines: int FuncName() {···················}|
40 after fold | {8: 40 }after fold |
41 +-- 7 lines: int FuncName() {···················| {8: 41 }{13:+-- 7 lines: int FuncName() {···················}|
48 after fold | {8: 48 }after fold |
[No Name] [+] | {2:[No Name] [+] }|
:wincmd s | :wincmd s |
]]) ]])
feed(':quit<CR>') feed(':quit<CR>')
screen:expect([[ screen:expect([[
1 +-- 7 lines: int FuncName() {···················| {8: 1 }{13:+-- 7 lines: int FuncName() {···················}|
8 after fold | {8: 8 }after fold |
9 +-- 7 lines: int FuncName() {···················| {8: 9 }{13:+-- 7 lines: int FuncName() {···················}|
16 after fold | {8: 16 }after fold |
17 +-- 7 lines: int FuncName() {···················| {8: 17 }{13:+-- 7 lines: int FuncName() {···················}|
24 after fold | {8: 24 }after fold |
25 +-- 7 lines: int FuncName() {···················| {8: 25 }{13:+-- 7 lines: int FuncName() {···················}|
32 after fold | {8: 32 }after fold |
33 +-- 7 lines: int FuncName() {···················| {8: 33 }{13:+-- 7 lines: int FuncName() {···················}|
40 after fold | {8: 40 }after fold |
41 +-- 7 lines: int FuncName() {···················| {8: 41 }{13:+-- 7 lines: int FuncName() {···················}|
48 after fold | {8: 48 }after fold |
49 ^+-- 7 lines: int FuncName() {···················| {8: 49 }{13:^+-- 7 lines: int FuncName() {···················}|
:quit | :quit |
]]) ]])
feed('H:below split<CR>') feed('H:below split<CR>')
screen:expect([[ screen:expect([[
1 +-- 7 lines: int FuncName() {···················| {8: 1 }{13:+-- 7 lines: int FuncName() {···················}|
8 after fold | {8: 8 }after fold |
9 +-- 7 lines: int FuncName() {···················| {8: 9 }{13:+-- 7 lines: int FuncName() {···················}|
16 after fold | {8: 16 }after fold |
17 +-- 7 lines: int FuncName() {···················| {8: 17 }{13:+-- 7 lines: int FuncName() {···················}|
[No Name] [+] | {2:[No Name] [+] }|
25 ^+-- 7 lines: int FuncName() {···················| {8: 25 }{13:^+-- 7 lines: int FuncName() {···················}|
32 after fold | {8: 32 }after fold |
33 +-- 7 lines: int FuncName() {···················| {8: 33 }{13:+-- 7 lines: int FuncName() {···················}|
40 after fold | {8: 40 }after fold |
41 +-- 7 lines: int FuncName() {···················| {8: 41 }{13:+-- 7 lines: int FuncName() {···················}|
48 after fold | {8: 48 }after fold |
[No Name] [+] | {3:[No Name] [+] }|
:below split | :below split |
]]) ]])
feed(':wincmd k<CR>:quit<CR>') feed(':wincmd k<CR>:quit<CR>')
screen:expect([[ screen:expect([[
1 +-- 7 lines: int FuncName() {···················| {8: 1 }{13:+-- 7 lines: int FuncName() {···················}|
8 after fold | {8: 8 }after fold |
9 +-- 7 lines: int FuncName() {···················| {8: 9 }{13:+-- 7 lines: int FuncName() {···················}|
16 after fold | {8: 16 }after fold |
17 +-- 7 lines: int FuncName() {···················| {8: 17 }{13:+-- 7 lines: int FuncName() {···················}|
24 after fold | {8: 24 }after fold |
25 ^+-- 7 lines: int FuncName() {···················| {8: 25 }{13:^+-- 7 lines: int FuncName() {···················}|
32 after fold | {8: 32 }after fold |
33 +-- 7 lines: int FuncName() {···················| {8: 33 }{13:+-- 7 lines: int FuncName() {···················}|
40 after fold | {8: 40 }after fold |
41 +-- 7 lines: int FuncName() {···················| {8: 41 }{13:+-- 7 lines: int FuncName() {···················}|
48 after fold | {8: 48 }after fold |
49 +-- 7 lines: int FuncName() {···················| {8: 49 }{13:+-- 7 lines: int FuncName() {···················}|
:quit | :quit |
]]) ]])
end) end)
@ -296,13 +296,13 @@ describe('splitkeep', function()
a | a |
b | b |
c | c |
~ |*4 {1:~ }|*4
[No Name] | {2:[No Name] }|
^a | ^a |
b | b |
c | c |
~ | {1:~ }|
[No Name] | {3:[No Name] }|
| |
]]) ]])
end) end)
@ -317,16 +317,16 @@ describe('splitkeep', function()
wincmd s wincmd s
]]) ]])
screen:expect([[ screen:expect([[
<<<e line with lots of text in one line | {1:<<<}e line with lots of text in one line |
with lots of text in one line with lots | with lots of text in one line with lots |
of text in one line | of text in one line |
~ | {1:~ }|
[No Name] [+] | {2:[No Name] [+] }|
<<<e line with lots of text in one line | {1:<<<}e line with lots of text in one line |
^with lots of text in one line with lots | ^with lots of text in one line with lots |
of text in one line | of text in one line |
~ |*2 {1:~ }|*2
[No Name] [+] | {3:[No Name] [+] }|
| |
]]) ]])
end) end)

View File

@ -22,7 +22,7 @@ describe("'fillchars'", function()
eq('', eval('&fillchars')) eq('', eval('&fillchars'))
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]]) ]])
end) end)
@ -30,13 +30,14 @@ describe("'fillchars'", function()
it('supports whitespace', function() it('supports whitespace', function()
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]]) ]])
command('set fillchars=eob:\\ ') command('set fillchars=eob:\\ ')
screen:expect([[ screen:expect([[
^ | ^ |
|*4 {1: }|*3
|
]]) ]])
end) end)
@ -44,7 +45,7 @@ describe("'fillchars'", function()
command('set fillchars=eob:ñ') command('set fillchars=eob:ñ')
screen:expect([[ screen:expect([[
^ | ^ |
ñ |*3 {1:ñ }|*3
| |
]]) ]])
end) end)
@ -53,7 +54,7 @@ describe("'fillchars'", function()
command('set fillchars=eob:å̲') command('set fillchars=eob:å̲')
screen:expect([[ screen:expect([[
^ | ^ |
å̲ |*3 {1:å̲ }|*3
| |
]]) ]])
end) end)
@ -112,8 +113,8 @@ describe("'fillchars'", function()
command('vsplit') command('vsplit')
command('set fillchars=fold:x') command('set fillchars=fold:x')
screen:expect([[ screen:expect([[
^+-- 2 lines: fooxxxxxxxx+-- 2 lines: fooxxxxxxx| {13:^+-- 2 lines: fooxxxxxxxx}{13:+-- 2 lines: fooxxxxxxx}|
~ ~ |*3 {1:~ }{1:~ }|*3
| |
]]) ]])
end) end)
@ -126,8 +127,8 @@ describe("'fillchars'", function()
command('vsplit') command('vsplit')
command('setl fillchars=fold:x') command('setl fillchars=fold:x')
screen:expect([[ screen:expect([[
^+-- 2 lines: fooxxxxxxxx+-- 2 lines: foo·······| {13:^+-- 2 lines: fooxxxxxxxx}{13:+-- 2 lines: foo·······}|
~ ~ |*3 {1:~ }{1:~ }|*3
| |
]]) ]])
end) end)
@ -141,8 +142,8 @@ describe("'fillchars'", function()
command('vsplit') command('vsplit')
command('set fillchars&') command('set fillchars&')
screen:expect([[ screen:expect([[
^+-- 2 lines: foo········+-- 2 lines: fooxxxxxxx| {13:^+-- 2 lines: foo········}{13:+-- 2 lines: fooxxxxxxx}|
~ ~ |*3 {1:~ }{1:~ }|*3
| |
]]) ]])
end) end)
@ -163,8 +164,8 @@ describe("'listchars'", function()
command('vsplit') command('vsplit')
command('set listchars=tab:<->') command('set listchars=tab:<->')
screen:expect([[ screen:expect([[
<------><------>^<------> <------><------><------>| {1:<------><------>^<------>} {1:<------><------><------>}|
~ ~ |*3 {1:~ }{1:~ }|*3
| |
]]) ]])
end) end)
@ -176,8 +177,8 @@ describe("'listchars'", function()
command('vsplit') command('vsplit')
command('setl listchars<') command('setl listchars<')
screen:expect([[ screen:expect([[
> > ^> <------><------><------>| {1:> > ^> } {1:<------><------><------>}|
~ ~ |*3 {1:~ }{1:~ }|*3
| |
]]) ]])
end) end)
@ -189,8 +190,8 @@ describe("'listchars'", function()
command('vsplit') command('vsplit')
command('set listchars=tab:>-,eol:$') command('set listchars=tab:>-,eol:$')
screen:expect([[ screen:expect([[
>------->-------^>-------$<------><------><------>| {1:>------->-------^>-------$}{1:<------><------><------>}|
~ ~ |*3 {1:~ }{1:~ }|*3
| |
]]) ]])
end) end)

View File

@ -32,7 +32,7 @@ describe('startup defaults', function()
command('filetype') command('filetype')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*2 {1:~ }|*2
]] .. expected) ]] .. expected)
end end
@ -132,9 +132,9 @@ describe('startup defaults', function()
command('vsp') command('vsp')
screen:expect([[ screen:expect([[
1 1 | 1 1 |
^+-- 2 lines: 2··········+-- 2 lines: 2·········| {13:^+-- 2 lines: 2··········}{13:+-- 2 lines: 2·········}|
4 4 | 4 4 |
~ ~ | {1:~ }{1:~ }|
| |
]]) ]])
@ -142,9 +142,9 @@ describe('startup defaults', function()
command('set ambiwidth=double') command('set ambiwidth=double')
screen:expect([[ screen:expect([[
1 |1 | 1 |1 |
^+-- 2 lines: 2----------|+-- 2 lines: 2---------| {13:^+-- 2 lines: 2----------}|{13:+-- 2 lines: 2---------}|
4 |4 | 4 |4 |
~ |~ | {1:~ }|{1:~ }|
| |
]]) ]])
@ -152,9 +152,9 @@ describe('startup defaults', function()
fn.setcellwidths({ { 0x2502, 0x2502, 1 } }) fn.setcellwidths({ { 0x2502, 0x2502, 1 } })
screen:expect([[ screen:expect([[
1 1 | 1 1 |
^+-- 2 lines: 2----------│+-- 2 lines: 2---------| {13:^+-- 2 lines: 2----------}{13:+-- 2 lines: 2---------}|
4 4 | 4 4 |
~ ~ | {1:~ }{1:~ }|
| |
]]) ]])
@ -162,9 +162,9 @@ describe('startup defaults', function()
fn.setcellwidths({ { 0x2502, 0x2502, 2 } }) fn.setcellwidths({ { 0x2502, 0x2502, 2 } })
screen:expect([[ screen:expect([[
1 |1 | 1 |1 |
^+-- 2 lines: 2----------|+-- 2 lines: 2---------| {13:^+-- 2 lines: 2----------}|{13:+-- 2 lines: 2---------}|
4 |4 | 4 |4 |
~ |~ | {1:~ }|{1:~ }|
| |
]]) ]])
@ -172,9 +172,9 @@ describe('startup defaults', function()
command('set ambiwidth=single') command('set ambiwidth=single')
screen:expect([[ screen:expect([[
1 |1 | 1 |1 |
^+-- 2 lines: 2··········|+-- 2 lines: 2·········| {13:^+-- 2 lines: 2··········}|{13:+-- 2 lines: 2·········}|
4 |4 | 4 |4 |
~ |~ | {1:~ }|{1:~ }|
| |
]]) ]])
end) end)

View File

@ -22,7 +22,7 @@ describe("'shortmess'", function()
feed(':edit foo<CR>') feed(':edit foo<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
"foo" [New] | "foo" [New] |
]]) ]])
eq(1, eval('bufnr("%")')) eq(1, eval('bufnr("%")'))
@ -31,7 +31,7 @@ describe("'shortmess'", function()
feed(':edit bar<CR>') feed(':edit bar<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
:edit bar | :edit bar |
]]) ]])
eq(2, eval('bufnr("%")')) eq(2, eval('bufnr("%")'))
@ -43,21 +43,21 @@ describe("'shortmess'", function()
feed(':edit foo<CR>') feed(':edit foo<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
"foo" [New] | "foo" [New] |
]]) ]])
eq(1, eval('bufnr("%")')) eq(1, eval('bufnr("%")'))
feed(':edit bar<CR>') feed(':edit bar<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
"bar" [New] | "bar" [New] |
]]) ]])
eq(2, eval('bufnr("%")')) eq(2, eval('bufnr("%")'))
feed(':bprevious<CR>') feed(':bprevious<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
"foo" [New] --No lines in buffer-- | "foo" [New] --No lines in buffer-- |
]]) ]])
eq(1, eval('bufnr("%")')) eq(1, eval('bufnr("%")'))
@ -66,14 +66,14 @@ describe("'shortmess'", function()
feed(':bnext<CR>') feed(':bnext<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
:bnext | :bnext |
]]) ]])
eq(2, eval('bufnr("%")')) eq(2, eval('bufnr("%")'))
feed(':bprevious<CR>') feed(':bprevious<CR>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
:bprevious | :bprevious |
]]) ]])
eq(1, eval('bufnr("%")')) eq(1, eval('bufnr("%")'))

View File

@ -166,11 +166,11 @@ describe('health.vim', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
| {14:}|
+WE 4 lines: foo: ·······························| {13:+WE 4 lines: foo: ·······························}|
| {14:}|
+-- 8 lines: test_plug.success1: require("test_pl| {13:+-- 8 lines: test_plug.success1: require("test_pl}|
~ | {1:~ }|
| |
]], ]],
} }
@ -218,6 +218,12 @@ describe(':checkhealth window', function()
it('opens directly if no buffer created', function() it('opens directly if no buffer created', function()
local screen = Screen.new(50, 12) local screen = Screen.new(50, 12)
screen:set_default_attr_ids {
[1] = { foreground = Screen.colors.Blue, bold = true },
[14] = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray },
[31] = { foreground = tonumber('0x6a0dad') },
[32] = { foreground = Screen.colors.PaleGreen2 },
}
screen:attach({ ext_multigrid = true }) screen:attach({ ext_multigrid = true })
command('checkhealth success1') command('checkhealth success1')
screen:expect { screen:expect {
@ -227,16 +233,16 @@ describe(':checkhealth window', function()
[3:--------------------------------------------------]| [3:--------------------------------------------------]|
## grid 2 ## grid 2
^ | ^ |
| {14:}|
| {14:} |
test_plug.success1: require("test_plug.success1. | {31:test_plug.success1: require("test_plug.success1. }|
health").check() | {31:health").check()} |
| |
report 1 | {31:report 1} |
- OK everything is fine | - {32:OK} everything is fine |
| |
report 2 | {31:report 2} |
- OK nothing to see here | - {32:OK} nothing to see here |
## grid 3 ## grid 3
| |
]], ]],
@ -245,6 +251,12 @@ describe(':checkhealth window', function()
local function test_health_vsplit(left, emptybuf, mods) local function test_health_vsplit(left, emptybuf, mods)
local screen = Screen.new(50, 20) local screen = Screen.new(50, 20)
screen:set_default_attr_ids {
[1] = { foreground = Screen.colors.Blue, bold = true },
[14] = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray },
[31] = { foreground = tonumber('0x6a0dad') },
[32] = { foreground = Screen.colors.PaleGreen2 },
}
screen:attach({ ext_multigrid = true }) screen:attach({ ext_multigrid = true })
if not emptybuf then if not emptybuf then
insert('hello') insert('hello')
@ -257,24 +269,24 @@ describe(':checkhealth window', function()
[3:--------------------------------------------------]| [3:--------------------------------------------------]|
## grid 2 ## grid 2
%s | %s |
~ |*18 {1:~ }|*18
## grid 3 ## grid 3
| |
## grid 4 ## grid 4
^ | ^ |
|*3 {14:}|*3
| {14:} |
test_plug.success1: | {31:test_plug.success1: }|
require("test_plug. | {31:require("test_plug. }|
success1.health").check()| {31:success1.health").check()}|
| |
report 1 | {31:report 1} |
- OK everything is fine | - {32:OK} everything is fine |
| |
report 2 | {31:report 2} |
- OK nothing to see here | - {32:OK} nothing to see here |
| |
~ |*4 {1:~ }|*4
]]):format( ]]):format(
left and '[4:-------------------------]│[2:------------------------]|*19' left and '[4:-------------------------]│[2:------------------------]|*19'
or '[2:------------------------]│[4:-------------------------]|*19', or '[2:------------------------]│[4:-------------------------]|*19',
@ -304,6 +316,7 @@ describe(':checkhealth window', function()
local function test_health_split(top, emptybuf, mods) local function test_health_split(top, emptybuf, mods)
local screen = Screen.new(50, 25) local screen = Screen.new(50, 25)
screen:attach({ ext_multigrid = true }) screen:attach({ ext_multigrid = true })
screen._default_attr_ids = nil
if not emptybuf then if not emptybuf then
insert('hello') insert('hello')
end end

View File

@ -41,12 +41,12 @@ local grid_without_inlay_hints = [[
]] ]]
local grid_with_inlay_hints = [[ local grid_with_inlay_hints = [[
auto add(int a, int b)-> int { return a + b; } | auto add(int a, int b){1:-> int} { return a + b; } |
| |
int main() { | int main() { |
int x = 1; | int x = 1; |
int y = 2; | int y = 2; |
return add(a: x,b: y); | return add({1:a:} x,{1:b:} y); |
} | } |
^} | ^} |
| |

View File

@ -121,6 +121,7 @@ it('chansend sends lines to terminal channel in proper order', function()
clear({ args = { '--cmd', 'set laststatus=2' } }) clear({ args = { '--cmd', 'set laststatus=2' } })
local screen = Screen.new(100, 20) local screen = Screen.new(100, 20)
screen:attach() screen:attach()
screen._default_attr_ids = nil
local shells = is_os('win') and { 'cmd.exe', 'pwsh.exe -nop', 'powershell.exe -nop' } or { 'sh' } local shells = is_os('win') and { 'cmd.exe', 'pwsh.exe -nop', 'powershell.exe -nop' } or { 'sh' }
for _, sh in ipairs(shells) do for _, sh in ipairs(shells) do
command([[let id = termopen(']] .. sh .. [[')]]) command([[let id = termopen(']] .. sh .. [[')]])

View File

@ -21,6 +21,7 @@ describe(':terminal', function()
clear() clear()
screen = Screen.new(50, 4) screen = Screen.new(50, 4)
screen:attach({ rgb = false }) screen:attach({ rgb = false })
screen._default_attr_ids = nil
end) end)
it('does not interrupt Press-ENTER prompt #2748', function() it('does not interrupt Press-ENTER prompt #2748', function()
@ -168,6 +169,7 @@ local function test_terminal_with_fake_shell(backslash)
clear() clear()
screen = Screen.new(50, 4) screen = Screen.new(50, 4)
screen:attach({ rgb = false }) screen:attach({ rgb = false })
screen._default_attr_ids = nil
api.nvim_set_option_value('shell', shell_path, {}) api.nvim_set_option_value('shell', shell_path, {})
api.nvim_set_option_value('shellcmdflag', 'EXE', {}) api.nvim_set_option_value('shellcmdflag', 'EXE', {})
api.nvim_set_option_value('shellxquote', '', {}) -- win: avoid extra quotes api.nvim_set_option_value('shellxquote', '', {}) -- win: avoid extra quotes

View File

@ -361,16 +361,19 @@ describe(':terminal prints more lines than the screen height and exits', functio
line8 | line8 |
line9 | line9 |
| |
[Process exited 0] | [Process exited 0]{2: } |
-- TERMINAL -- | {5:-- TERMINAL --} |
]]) ]])
feed('<cr>') feed('<cr>')
-- closes the buffer correctly after pressing a key -- closes the buffer correctly after pressing a key
screen:expect([[ screen:expect {
grid = [[
^ | ^ |
~ |*5 {1:~ }|*5
| |
]]) ]],
attr_ids = { [1] = { foreground = 12 } },
}
end) end)
end) end)

View File

@ -204,7 +204,7 @@ describe('ui/cursor', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
~ |*3 {1:~ }|*3
test | test |
]], ]],
condition = function() condition = function()
@ -290,7 +290,7 @@ describe('ui/cursor', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
~ |*3 {1:~ }|*3
test | test |
]], ]],
condition = function() condition = function()

View File

@ -2680,6 +2680,7 @@ it('pager works in headless mode with UI attached', function()
local child_session = helpers.connect(child_server) local child_session = helpers.connect(child_server)
local child_screen = Screen.new(40, 6) local child_screen = Screen.new(40, 6)
child_screen:attach(nil, child_session) child_screen:attach(nil, child_session)
child_screen._default_attr_ids = nil -- TODO: unskip with new color scheme
child_session:notify('nvim_command', [[echo range(100)->join("\n")]]) child_session:notify('nvim_command', [[echo range(100)->join("\n")]])
child_screen:expect([[ child_screen:expect([[

View File

@ -256,28 +256,28 @@ describe('shell command :!', function()
:!'Write-Output $a' | :!'Write-Output $a' |
Write-Output $a | Write-Output $a |
| |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed_command([[!$a = 1; Write-Output '$a']]) feed_command([[!$a = 1; Write-Output '$a']])
screen:expect([[ screen:expect([[
:!$a = 1; Write-Output '$a' | :!$a = 1; Write-Output '$a' |
$a | $a |
| |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed_command([[!"Write-Output $a"]]) feed_command([[!"Write-Output $a"]])
screen:expect([[ screen:expect([[
:!"Write-Output $a" | :!"Write-Output $a" |
Write-Output | Write-Output |
| |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed_command([[!$a = 1; Write-Output "$a"]]) feed_command([[!$a = 1; Write-Output "$a"]])
screen:expect([[ screen:expect([[
:!$a = 1; Write-Output "$a" | :!$a = 1; Write-Output "$a" |
1 | 1 |
| |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
if is_os('win') then if is_os('win') then
feed_command([[!& 'cmd.exe' /c 'echo $a']]) feed_command([[!& 'cmd.exe' /c 'echo $a']])
@ -285,7 +285,7 @@ describe('shell command :!', function()
:!& 'cmd.exe' /c 'echo $a' | :!& 'cmd.exe' /c 'echo $a' |
$a | $a |
| |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
else else
feed_command([[!& '/bin/sh' -c 'echo ''$a''']]) feed_command([[!& '/bin/sh' -c 'echo ''$a''']])
@ -293,7 +293,7 @@ describe('shell command :!', function()
:!& '/bin/sh' -c 'echo ''$a''' | :!& '/bin/sh' -c 'echo ''$a''' |
$a | $a |
| |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
end end
end) end)

View File

@ -139,6 +139,43 @@ local function _init_colors()
end end
Screen.colors = colors Screen.colors = colors
Screen.colornames = colornames Screen.colornames = colornames
Screen._global_default_attr_ids = {
[1] = { foreground = Screen.colors.Blue1, bold = true },
[2] = { reverse = true },
[3] = { bold = true, reverse = true },
[4] = { background = Screen.colors.LightMagenta },
[5] = { bold = true },
[6] = { foreground = Screen.colors.SeaGreen, bold = true },
[7] = { background = Screen.colors.Gray, foreground = Screen.colors.DarkBlue },
[8] = { foreground = Screen.colors.Brown },
[9] = { background = Screen.colors.Red, foreground = Screen.colors.Grey100 },
[10] = { background = Screen.colors.Yellow },
[11] = {
foreground = Screen.colors.Blue1,
background = Screen.colors.LightMagenta,
bold = true,
},
[12] = { background = Screen.colors.Gray },
[13] = { background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue },
[14] = { background = Screen.colors.DarkGray, foreground = Screen.colors.LightGrey },
[15] = { foreground = Screen.colors.Brown, bold = true },
[16] = { foreground = Screen.colors.SlateBlue },
[17] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
[18] = { foreground = Screen.colors.Blue1 },
[19] = { foreground = Screen.colors.Red },
[20] = { background = Screen.colors.Yellow, foreground = Screen.colors.Red },
[21] = { background = Screen.colors.Grey90 },
[22] = { background = Screen.colors.LightBlue },
[23] = { foreground = Screen.colors.Blue1, background = Screen.colors.LightCyan, bold = true },
[24] = { background = Screen.colors.LightGrey, underline = true },
[25] = { foreground = Screen.colors.Cyan4 },
[26] = { foreground = Screen.colors.Fuchsia },
[27] = { background = Screen.colors.Red, bold = true },
[28] = { foreground = Screen.colors.SlateBlue, underline = true },
[29] = { foreground = Screen.colors.SlateBlue, bold = true },
[30] = { background = Screen.colors.Red },
}
end end
--- @param width? integer --- @param width? integer
@ -257,6 +294,10 @@ function Screen:attach(options, session)
if self._options.ext_multigrid then if self._options.ext_multigrid then
self._options.ext_linegrid = true self._options.ext_linegrid = true
end end
if self._default_attr_ids == nil then
self._default_attr_ids = Screen._global_default_attr_ids
end
end end
function Screen:detach() function Screen:detach()
@ -480,7 +521,10 @@ function Screen:expect(expected, attr_ids, ...)
attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids or {}) attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids or {})
end end
local actual_rows = self:render(not expected.any, attr_state) local actual_rows
if expected.any or grid then
actual_rows = self:render(not expected.any, attr_state)
end
if expected.any then if expected.any then
-- Search for `any` anywhere in the screen lines. -- Search for `any` anywhere in the screen lines.

View File

@ -27,38 +27,38 @@ describe('statuscolumn', function()
[[set stc=%{v:relnum?v:relnum:(v:lnum==5?'truncate':v:lnum)}%{!v:relnum&&v:lnum==5?invalid:''}\ ]] [[set stc=%{v:relnum?v:relnum:(v:lnum==5?'truncate':v:lnum)}%{!v:relnum&&v:lnum==5?invalid:''}\ ]]
) )
screen:expect([[ screen:expect([[
4 aaaaa | {8:4 }aaaaa |
3 aaaaa | {8:3 }aaaaa |
2 aaaaa | {8:2 }aaaaa |
1 aaaaa | {8:1 }aaaaa |
8 ^aaaaa | {8:8 }^aaaaa |
1 aaaaa | {8:1 }aaaaa |
2 aaaaa | {8:2 }aaaaa |
3 aaaaa | {8:3 }aaaaa |
4 aaaaa | {8:4 }aaaaa |
5 aaaaa | {8:5 }aaaaa |
6 aaaaa | {8:6 }aaaaa |
7 aaaaa | {8:7 }aaaaa |
8 aaaaa | {8:8 }aaaaa |
| |
]]) ]])
command('norm 5G') command('norm 5G')
eq('Vim(redraw):E121: Undefined variable: invalid', pcall_err(command, 'redraw!')) eq('Vim(redraw):E121: Undefined variable: invalid', pcall_err(command, 'redraw!'))
eq('', eval('&statuscolumn')) eq('', eval('&statuscolumn'))
screen:expect([[ screen:expect([[
4 aaaaa | {8: 4 }aaaaa |
5 ^aaaaa | {8: 5 }^aaaaa |
6 aaaaa | {8: 6 }aaaaa |
7 aaaaa | {8: 7 }aaaaa |
8 aaaaa | {8: 8 }aaaaa |
9 aaaaa | {8: 9 }aaaaa |
10 aaaaa | {8:10 }aaaaa |
11 aaaaa | {8:11 }aaaaa |
12 aaaaa | {8:12 }aaaaa |
13 aaaaa | {8:13 }aaaaa |
14 aaaaa | {8:14 }aaaaa |
15 aaaaa | {8:15 }aaaaa |
16 aaaaa | {8:16 }aaaaa |
| |
]]) ]])
end) end)
@ -72,9 +72,9 @@ describe('statuscolumn', function()
norm 5G | redraw! norm 5G | redraw!
]=]) ]=])
screen:expect([[ screen:expect([[
1 aaaaa virt_text | {8:1 }aaaaa virt_text |
bbbbba^eaaa | {8:bbbbb}a^eaaa |
1 aaaaa | {8:1 }aaaaa |
| |
]]) ]])
-- Doesn't crash when trying to fill click defs that do not fit (#26845) -- Doesn't crash when trying to fill click defs that do not fit (#26845)
@ -84,9 +84,9 @@ describe('statuscolumn', function()
norm 5Gzt | redraw! norm 5Gzt | redraw!
]=]) ]=])
screen:expect([[ screen:expect([[
bbbbba^eaaa | {8:bbbbb}a^eaaa |
1 aaaaa | {8:1 }aaaaa |
2 aaaaa | {8:2 }aaaaa |
| |
]]) ]])
end) end)
@ -94,19 +94,19 @@ describe('statuscolumn', function()
it("works with 'number' and 'relativenumber'", function() it("works with 'number' and 'relativenumber'", function()
command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]])
screen:expect([[ screen:expect([[
4 aaaaa | {8:4 }aaaaa |
5 aaaaa | {8:5 }aaaaa |
6 aaaaa | {8:6 }aaaaa |
7 aaaaa | {8:7 }aaaaa |
8 ^aaaaa | {8:8 }^aaaaa |
9 aaaaa | {8:9 }aaaaa |
10aaaaa | {8:10}aaaaa |
11aaaaa | {8:11}aaaaa |
12aaaaa | {8:12}aaaaa |
13aaaaa | {8:13}aaaaa |
14aaaaa | {8:14}aaaaa |
15aaaaa | {8:15}aaaaa |
16aaaaa | {8:16}aaaaa |
| |
]]) ]])
command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) command([[set stc=%l%=%{&rnu?'\ ':''}%r│]])
@ -114,39 +114,19 @@ describe('statuscolumn', function()
command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]])
command('set relativenumber') command('set relativenumber')
screen:expect([[ screen:expect([[
4 4aaaaa | {8:4 4}aaaaa |
5 3aaaaa | {8:5 3}aaaaa |
6 2aaaaa | {8:6 2}aaaaa |
7 1aaaaa | {8:7 1}aaaaa |
8 0^aaaaa | {8:8 0}^aaaaa |
9 1aaaaa | {8:9 1}aaaaa |
10 2aaaaa | {8:10 2}aaaaa |
11 3aaaaa | {8:11 3}aaaaa |
12 4aaaaa | {8:12 4}aaaaa |
13 5aaaaa | {8:13 5}aaaaa |
14 6aaaaa | {8:14 6}aaaaa |
15 7aaaaa | {8:15 7}aaaaa |
16 8aaaaa | {8:16 8}aaaaa |
|
]])
command([[set stc=%l%=%{&rnu?'\ ':''}%r│]])
screen:expect_unchanged()
command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]])
command('norm 12GH')
screen:expect([[
4 0^aaaaa |
5 1aaaaa |
6 2aaaaa |
7 3aaaaa |
8 4aaaaa |
9 5aaaaa |
10 6aaaaa |
11 7aaaaa |
12 8aaaaa |
13 9aaaaa |
14 10aaaaa |
15 11aaaaa |
16 12aaaaa |
| |
]]) ]])
command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) command([[set stc=%l%=%{&rnu?'\ ':''}%r│]])
@ -735,19 +715,19 @@ describe('statuscolumn', function()
virt_lines_leftcol = true, virt_lines = {{{"virt", ""}}} }) virt_lines_leftcol = true, virt_lines = {{{"virt", ""}}} })
]]) ]])
screen:expect([[ screen:expect([[
4 aaaaa | {7: }{8: 4 }aaaaa |
5 aaaaa | {7: }{8: 5 }aaaaa |
6 aaaaa | {7: }{8: 6 }aaaaa |
7 aaaaa | {7: }{8: 7 }aaaaa |
virt | virt |
--------- 8 ^aaaaa | {7:---------}{8: 8 }^aaaaa |
virt | virt |
𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀 9 aaaaa | {7:𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀}{8: 9 }aaaaa |
10 aaaaa | {7: }{8:10 }aaaaa |
11 aaaaa | {7: }{8:11 }aaaaa |
12 aaaaa | {7: }{8:12 }aaaaa |
13 aaaaa | {7: }{8:13 }aaaaa |
14 aaaaa | {7: }{8:14 }aaaaa |
| |
]]) ]])
command('set stc=') -- also for the default fold column command('set stc=') -- also for the default fold column
@ -756,18 +736,18 @@ describe('statuscolumn', function()
command([[set stc=%{foldlevel(v:lnum)>0?repeat('-',foldlevel(v:lnum)):''}%=%l\ ]]) command([[set stc=%{foldlevel(v:lnum)>0?repeat('-',foldlevel(v:lnum)):''}%=%l\ ]])
feed('Gd10Ggg<C-l>') feed('Gd10Ggg<C-l>')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8: 1 }^aaaaa |
2 aaaaa | {8: 2 }aaaaa |
3 aaaaa | {8: 3 }aaaaa |
4 aaaaa | {8: 4 }aaaaa |
5 aaaaa | {8: 5 }aaaaa |
6 aaaaa | {8: 6 }aaaaa |
7 aaaaa | {8: 7 }aaaaa |
virt | virt |
---------8 aaaaa | {8:---------8 }aaaaa |
virt | virt |
---------9 aaaaa | {8:---------9 }aaaaa |
~ |*2 {1:~ }|*2
| |
]]) ]])
end) end)
@ -775,15 +755,15 @@ describe('statuscolumn', function()
it('works with cmdwin', function() it('works with cmdwin', function()
feed(':set stc=%l<CR>q:k$') feed(':set stc=%l<CR>q:k$')
screen:expect([[ screen:expect([[
7 aaaaa | {8:7 }aaaaa |
8 aaaaa | {8:8 }aaaaa |
9 aaaaa | {8:9 }aaaaa |
10aaaaa | {8:10}aaaaa |
[No Name] [+] | {2:[No Name] [+] }|
:1set stc=%^l | {1::}{8:1}set stc=%^l |
:2 | {1::}{8:2} |
~ |*5 {1:~ }|*5
[Command Line] | {3:[Command Line] }|
: | : |
]]) ]])
end) end)
@ -794,11 +774,11 @@ describe('statuscolumn', function()
command('set relativenumber') command('set relativenumber')
command([[set stc=%{!&nu&&!&rnu?'':&rnu?v:relnum?v:relnum:&nu?v:lnum:'0':v:lnum}]]) command([[set stc=%{!&nu&&!&rnu?'':&rnu?v:relnum?v:relnum:&nu?v:lnum:'0':v:lnum}]])
screen:expect([[ screen:expect([[
1 aaaaa | {8:1 }aaaaa |
8 ^aaaaa | {8:8 }^aaaaa |
1 aaaaa | {8:1 }aaaaa |
2 aaaaa | {8:2 }aaaaa |
3 aaaaa | {8:3 }aaaaa |
| |
]]) ]])
-- width correctly estimated with "w_nrwidth_line_count" when setting 'stc' -- width correctly estimated with "w_nrwidth_line_count" when setting 'stc'
@ -815,11 +795,11 @@ describe('statuscolumn', function()
-- width correctly estimated with "w_nrwidth_line_count" when setting 'nu' -- width correctly estimated with "w_nrwidth_line_count" when setting 'nu'
command('set number') command('set number')
screen:expect([[ screen:expect([[
7 aaaaa | {8:7 }aaaaa |
8 ^aaaaa | {8:8 }^aaaaa |
9 aaaaa | {8:9 }aaaaa |
10 aaaaa | {8:10 }aaaaa |
11 aaaaa | {8:11 }aaaaa |
| |
]]) ]])
end) end)
@ -846,59 +826,59 @@ describe('statuscolumn', function()
]]) ]])
command('sign place 1 line=2 name=sign') command('sign place 1 line=2 name=sign')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 ssaaaaa | {8:2 ss}aaaaa |
| |
]]) ]])
command('sign place 2 line=2 name=sign') command('sign place 2 line=2 name=sign')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 ssssaaaaa | {8:2 ssss}aaaaa |
| |
]]) ]])
command('sign unplace 2') command('sign unplace 2')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 ssaaaaa | {8:2 ss}aaaaa |
| |
]]) ]])
command('sign unplace 1') command('sign unplace 1')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 aaaaa | {8:2 }aaaaa |
| |
]]) ]])
-- Also for extmark signs -- Also for extmark signs
exec_lua('id1 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})') exec_lua('id1 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 ssaaaaa | {8:2 ss}aaaaa |
| |
]]) ]])
exec_lua('id2 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})') exec_lua('id2 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 ssssaaaaa | {8:2 ssss}aaaaa |
| |
]]) ]])
exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id1)') exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id1)')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 ssaaaaa | {8:2 ss}aaaaa |
| |
]]) ]])
exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id2)') exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id2)')
screen:expect([[ screen:expect([[
1 ^aaaaa | {8:1 }^aaaaa |
2 aaaaa | {8:2 }aaaaa |
| |
]]) ]])
-- In all windows -- In all windows
command('wincmd v | set ls=0') command('wincmd v | set ls=0')
command('sign place 1 line=2 name=sign') command('sign place 1 line=2 name=sign')
screen:expect([[ screen:expect([[
1 ^aaaaa 1 aaaaa | {8:1 }^aaaaa {8:1 }aaaaa |
2 ssaaaaa 2 ssaaaaa | {8:2 ss}aaaaa {8:2 ss}aaaaa |
| |
]]) ]])
end) end)
@ -918,12 +898,16 @@ describe('statuscolumn', function()
it('does not wrap multibyte characters at the end of a line', function() it('does not wrap multibyte characters at the end of a line', function()
screen:try_resize(33, 4) screen:try_resize(33, 4)
screen:set_default_attr_ids {
[8] = { foreground = Screen.colors.Brown },
[31] = { undercurl = true, special = Screen.colors.Red },
}
command([[set spell stc=%l\ ]]) command([[set spell stc=%l\ ]])
command('call setline(8, "This is a line that contains ᶏ multibyte character.")') command('call setline(8, "This is a line that contains ᶏ multibyte character.")')
screen:expect([[ screen:expect([[
8 ^This is a line that contains | {8:8 }^This is a line that contains {31:}|
multibyte character. | {8: } {31:multibyte} character. |
9 aaaaa | {8:9 }{31:aaaaa} |
| |
]]) ]])
end) end)
@ -934,9 +918,9 @@ describe('statuscolumn', function()
command('call setline(1, range(1, 99))') command('call setline(1, range(1, 99))')
feed('Gyyp') feed('Gyyp')
screen:expect([[ screen:expect([[
98 98 | {8:98 }98 |
99 99 | {8:99 }99 |
100 ^99 | {8:100 }^99 |
| |
]]) ]])
end) end)

View File

@ -596,57 +596,59 @@ it('statusline is redrawn on various state changes', function()
command('set ls=2 stl=%{repeat(reg_recording(),5)}') command('set ls=2 stl=%{repeat(reg_recording(),5)}')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
|*2 {3: }|
|
]]) ]])
feed('qQ') feed('qQ')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
QQQQQ | {3:QQQQQ }|
recording @Q | {5:recording @Q} |
]]) ]])
feed('q') feed('q')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
|*2 {3: }|
|
]]) ]])
-- Visual mode change #23932 -- Visual mode change #23932
command('set ls=2 stl=%{mode(1)}') command('set ls=2 stl=%{mode(1)}')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
n | {3:n }|
| |
]]) ]])
feed('v') feed('v')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
v | {3:v }|
-- VISUAL -- | {5:-- VISUAL --} |
]]) ]])
feed('V') feed('V')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
V | {3:V }|
-- VISUAL LINE -- | {5:-- VISUAL LINE --} |
]]) ]])
feed('<C-V>') feed('<C-V>')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
^V | {3:^V }|
-- VISUAL BLOCK -- | {5:-- VISUAL BLOCK --} |
]]) ]])
feed('<Esc>') feed('<Esc>')
screen:expect([[ screen:expect([[
^ | ^ |
~ | {1:~ }|
n | {3:n }|
| |
]]) ]])
end) end)

View File

@ -31,7 +31,7 @@ describe('ui/ext_tabline', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]], ]],
condition = function() condition = function()
@ -44,7 +44,7 @@ describe('ui/ext_tabline', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]], ]],
condition = function() condition = function()
@ -62,7 +62,7 @@ describe('ui/ext_tabline', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]], ]],
condition = function() condition = function()
@ -81,7 +81,7 @@ describe('ui/ext_tabline', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]], ]],
condition = function() condition = function()

View File

@ -14,6 +14,13 @@ describe("'wildmenu'", function()
before_each(function() before_each(function()
clear() clear()
screen = Screen.new(25, 5) screen = Screen.new(25, 5)
screen:set_default_attr_ids {
[1] = { foreground = Screen.colors.Blue, bold = true },
[2] = { reverse = true },
[3] = { bold = true, reverse = true },
[5] = { bold = true },
[31] = { foreground = Screen.colors.Grey0, background = Screen.colors.Yellow },
}
screen:attach() screen:attach()
end) end)
@ -105,14 +112,14 @@ describe("'wildmenu'", function()
feed(':sign <tab>') feed(':sign <tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
define jump list > | {31:define}{3: jump list > }|
:sign define^ | :sign define^ |
]]) ]])
feed('<C-E>') feed('<C-E>')
screen:expect([[ screen:expect([[
| |
~ |*3 {1:~ }|*3
:sign ^ | :sign ^ |
]]) ]])
end) end)
@ -121,14 +128,14 @@ describe("'wildmenu'", function()
feed(':sign <tab>') feed(':sign <tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
define jump list > | {31:define}{3: jump list > }|
:sign define^ | :sign define^ |
]]) ]])
feed('<tab><C-Y>') feed('<tab><C-Y>')
screen:expect([[ screen:expect([[
| |
~ |*3 {1:~ }|*3
:sign jump^ | :sign jump^ |
]]) ]])
end) end)
@ -138,8 +145,8 @@ describe("'wildmenu'", function()
feed(':sign <tab>') feed(':sign <tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
define jump list > | {31:define}{3: jump list > }|
:sign define^ | :sign define^ |
]]) ]])
end) end)
@ -152,15 +159,15 @@ describe("'wildmenu'", function()
feed(':sign <tab>') feed(':sign <tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
define jump list > | {31:define}{3: jump list > }|
:sign define^ | :sign define^ |
]]) ]])
feed('<space>') feed('<space>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
[No Name] | {3:[No Name] }|
:sign define ^ | :sign define ^ |
]]) ]])
end) end)
@ -170,16 +177,16 @@ describe("'wildmenu'", function()
feed(':j<Tab><Tab><Tab>') feed(':j<Tab><Tab><Tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
join jumps | {3:join jumps }|
:j^ | :j^ |
]]) ]])
-- This would cause nvim to crash before #6650 -- This would cause nvim to crash before #6650
feed('<BS><Tab>') feed('<BS><Tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
! # & < = > @ > | {31:!}{3: # & < = > @ > }|
:!^ | :!^ |
]]) ]])
end) end)
@ -192,7 +199,7 @@ describe("'wildmenu'", function()
feed([[:sign <Tab>]]) -- Invoke wildmenu. feed([[:sign <Tab>]]) -- Invoke wildmenu.
-- NB: in earlier versions terminal output was redrawn during cmdline mode. -- NB: in earlier versions terminal output was redrawn during cmdline mode.
-- For now just assert that the screen remains unchanged. -- For now just assert that the screen remains unchanged.
screen:expect { any = 'define jump list > |\n:sign define^ |' } screen:expect { any = '{31:define}{3: jump list > }|\n:sign define^ |' }
screen:expect_unchanged() screen:expect_unchanged()
-- cmdline CTRL-D display should also be preserved. -- cmdline CTRL-D display should also be preserved.
@ -222,8 +229,8 @@ describe("'wildmenu'", function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
~ |*2 {1:~ }|*2
define jump list > | {31:define}{3: jump list > }|
:sign define^ | :sign define^ |
]], ]],
} }
@ -252,7 +259,7 @@ describe("'wildmenu'", function()
feed([[:<Tab>]]) -- Invoke wildmenu. feed([[:<Tab>]]) -- Invoke wildmenu.
-- Check only the last 2 lines, because the shell output is -- Check only the last 2 lines, because the shell output is
-- system-dependent. -- system-dependent.
screen:expect { any = '! # & < = > @ > |\n:!^' } screen:expect { any = '{31:!}{3: # & < = > @ > }|\n:!^' }
-- Because this test verifies a _lack_ of activity, we must wait the full timeout. -- Because this test verifies a _lack_ of activity, we must wait the full timeout.
-- So make it reasonable. -- So make it reasonable.
screen:expect_unchanged(false, 1000) screen:expect_unchanged(false, 1000)
@ -266,27 +273,29 @@ describe("'wildmenu'", function()
command('set showtabline=2') command('set showtabline=2')
feed(':set wildm<tab>') feed(':set wildm<tab>')
screen:expect([[ screen:expect([[
[No Name] | {5: [No Name] }{2: }|
|
~ |
| |
{1:~ }|
{3: }|
:set wildm | :set wildm |
wildmenu wildmode | wildmenu wildmode |
:set wildm^ | :set wildm^ |
]]) ]])
feed('<tab>') -- trigger wildmode full feed('<tab>') -- trigger wildmode full
screen:expect([[ screen:expect([[
[No Name] | {5: [No Name] }{2: }|
|*2 |
{3: }|
:set wildm | :set wildm |
wildmenu wildmode |*2 wildmenu wildmode |
{31:wildmenu}{3: wildmode }|
:set wildmenu^ | :set wildmenu^ |
]]) ]])
feed('<Esc>') feed('<Esc>')
screen:expect([[ screen:expect([[
[No Name] | {5: [No Name] }{2: }|
^ | ^ |
~ |*4 {1:~ }|*4
| |
]]) ]])
end) end)
@ -301,14 +310,14 @@ describe("'wildmenu'", function()
feed(':sign u<tab>') feed(':sign u<tab>')
screen:expect([[ screen:expect([[
| |
~ |*5 {1:~ }|*5
:sign un^ | :sign un^ |
]]) ]])
feed('<tab>') -- trigger wildmode list feed('<tab>') -- trigger wildmode list
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
| {3: }|
:sign un | :sign un |
undefine unplace | undefine unplace |
:sign un^ | :sign un^ |
@ -316,7 +325,7 @@ describe("'wildmenu'", function()
feed('<Esc>') feed('<Esc>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*5 {1:~ }|*5
| |
]]) ]])
@ -324,8 +333,8 @@ describe("'wildmenu'", function()
feed(':sign un<tab>') feed(':sign un<tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
| {3: }|
:sign un | :sign un |
undefine unplace | undefine unplace |
:sign un^ | :sign un^ |
@ -335,7 +344,7 @@ describe("'wildmenu'", function()
feed('<Esc>') feed('<Esc>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*5 {1:~ }|*5
| |
]]) ]])
end) end)
@ -348,8 +357,8 @@ describe("'wildmenu'", function()
feed(':sign u<tab>') feed(':sign u<tab>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
| {3: }|
:sign u | :sign u |
undefine unplace | undefine unplace |
:sign u^ | :sign u^ |
@ -357,8 +366,8 @@ describe("'wildmenu'", function()
feed('<tab>') -- trigger wildmode longest feed('<tab>') -- trigger wildmode longest
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
| {3: }|
:sign u | :sign u |
undefine unplace | undefine unplace |
:sign un^ | :sign un^ |
@ -366,7 +375,7 @@ describe("'wildmenu'", function()
feed('<Esc>') feed('<Esc>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*5 {1:~ }|*5
| |
]]) ]])
end) end)
@ -379,15 +388,16 @@ describe("'wildmenu'", function()
feed('<c-d>') feed('<c-d>')
screen:expect([[ screen:expect([[
| |
~ |*2 {1:~ }|*2
| {3: }|
:set wildm | :set wildm |
wildmenu wildmode | wildmenu wildmode |
:set wildm^ | :set wildm^ |
]]) ]])
feed('<c-d>') feed('<c-d>')
screen:expect([[ screen:expect([[
|*2 |
{3: }|
:set wildm | :set wildm |
wildmenu wildmode | wildmenu wildmode |
:set wildm | :set wildm |
@ -397,8 +407,8 @@ describe("'wildmenu'", function()
feed('<Esc>') feed('<Esc>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
[No Name] | {3:[No Name] }|
| |
]]) ]])
end) end)
@ -594,7 +604,7 @@ describe('ui/ext_wildmenu', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
~ |*3 {1:~ }|*3
:sign define^ | :sign define^ |
]], ]],
wildmenu_items = expected, wildmenu_items = expected,
@ -605,7 +615,7 @@ describe('ui/ext_wildmenu', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
~ |*3 {1:~ }|*3
:sign jump^ | :sign jump^ |
]], ]],
wildmenu_items = expected, wildmenu_items = expected,
@ -616,7 +626,7 @@ describe('ui/ext_wildmenu', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
~ |*3 {1:~ }|*3
:sign ^ | :sign ^ |
]], ]],
wildmenu_items = expected, wildmenu_items = expected,
@ -627,7 +637,7 @@ describe('ui/ext_wildmenu', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
~ |*3 {1:~ }|*3
:sign define^ | :sign define^ |
]], ]],
wildmenu_items = expected, wildmenu_items = expected,
@ -638,7 +648,7 @@ describe('ui/ext_wildmenu', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
~ |*3 {1:~ }|*3
:sign definea^ | :sign definea^ |
]], ]],
} }

View File

@ -191,21 +191,21 @@ describe('execute()', function()
feed([[:call Test1()<cr>]]) feed([[:call Test1()<cr>]])
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
ABCD | ABCD |
]]) ]])
feed([[:call Test2()<cr>]]) feed([[:call Test2()<cr>]])
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
1234ABCD | 1234ABCD |
]]) ]])
feed([[:call Test3()<cr>]]) feed([[:call Test3()<cr>]])
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
1234ABCDXZYZ | 1234ABCDXZYZ |
]]) ]])
@ -215,39 +215,39 @@ describe('execute()', function()
-- "ef" was overwritten since msg_col was recovered wrongly -- "ef" was overwritten since msg_col was recovered wrongly
screen:expect([[ screen:expect([[
1234 | 1234 |
Error detected while processing function| {9:Error detected while processing function}|
Test4: | {9: Test4:} |
line 2: | {8:line 2:} |
abcdABCD | {9:abcd}ABCD |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed([[<cr>]]) -- to clear screen feed([[<cr>]]) -- to clear screen
feed([[:call Test5()<cr>]]) feed([[:call Test5()<cr>]])
screen:expect([[ screen:expect([[
^ | ^ |
~ |*4 {1:~ }|*4
1234ABCD | 1234ABCD |
]]) ]])
feed([[:call Test6()<cr>]]) feed([[:call Test6()<cr>]])
screen:expect([[ screen:expect([[
| |
Error detected while processing function| {9:Error detected while processing function}|
Test6: | {9: Test6:} |
line 2: | {8:line 2:} |
E121ABCD | {9:E121}ABCD |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed([[:call Test7()<cr>]]) feed([[:call Test7()<cr>]])
screen:expect([[ screen:expect([[
Error detected while processing function| {9:Error detected while processing function}|
Test6: | {9: Test6:} |
line 2: | {8:line 2:} |
E121ABCD | {9:E121}ABCD |
ABCD | ABCD |
Press ENTER or type command to continue^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
end) end)
@ -265,7 +265,7 @@ describe('execute()', function()
command('let g:mes = execute("echon 42", "")') command('let g:mes = execute("echon 42", "")')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
42 | 42 |
]]) ]])
eq('42', eval('g:mes')) eq('42', eval('g:mes'))
@ -289,7 +289,7 @@ describe('execute()', function()
command('let g:mes = execute("echon 42")') command('let g:mes = execute("echon 42")')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]]) ]])
eq('42', eval('g:mes')) eq('42', eval('g:mes'))
@ -298,7 +298,7 @@ describe('execute()', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
~ |*3 {1:~ }|*3
| |
]], ]],
unchanged = true, unchanged = true,

View File

@ -214,7 +214,7 @@ describe('system()', function()
feed(':call system("echo")<cr>') feed(':call system("echo")<cr>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*12 {1:~ }|*12
:call system("echo") | :call system("echo") |
]]) ]])
end) end)
@ -262,14 +262,14 @@ describe('system()', function()
) )
screen:expect([[ screen:expect([[
| |
~ |*12 {1:~ }|*12
]] .. (is_os('win') and [[ ]] .. (is_os('win') and [[
:call system("for /L %I in (1,0,2) do @echo y") |]] or [[ :call system("for /L %I in (1,0,2) do @echo y") |]] or [[
:call system("yes") |]])) :call system("yes") |]]))
feed('foo<c-c>') feed('foo<c-c>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*12 {1:~ }|*12
Type :qa and press <Enter> to exit Nvim | Type :qa and press <Enter> to exit Nvim |
]]) ]])
end) end)
@ -283,15 +283,15 @@ describe('system()', function()
) )
screen:expect([[ screen:expect([[
| |
~ |*12 {1:~ }|*12
]] .. (is_os('win') and [[ ]] .. (is_os('win') and [[
:call system("for /L %I in (1,0,2) do @echo y") |]] or [[ :call system("for /L %I in (1,0,2) do @echo y") |]] or [[
:call system("yes") |]])) :call system("yes") |]]))
feed('foo<c-c>') feed('foo<c-c>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*12 {1:~ }|*12
-- INSERT -- | {5:-- INSERT --} |
]]) ]])
end) end)
end) end)
@ -447,7 +447,7 @@ describe('systemlist()', function()
feed(':call systemlist("echo")<cr>') feed(':call systemlist("echo")<cr>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*12 {1:~ }|*12
:call systemlist("echo") | :call systemlist("echo") |
]]) ]])
end) end)
@ -456,13 +456,13 @@ describe('systemlist()', function()
feed(':call systemlist("yes | xargs")<cr>') feed(':call systemlist("yes | xargs")<cr>')
screen:expect([[ screen:expect([[
| |
~ |*12 {1:~ }|*12
:call systemlist("yes | xargs") | :call systemlist("yes | xargs") |
]]) ]])
feed('<c-c>') feed('<c-c>')
screen:expect([[ screen:expect([[
^ | ^ |
~ |*12 {1:~ }|*12
Type :qa and press <Enter> to exit Nvim | Type :qa and press <Enter> to exit Nvim |
]]) ]])
end) end)