aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/highlight_spec.lua34
-rw-r--r--test/functional/ui/messages_spec.lua47
-rw-r--r--test/functional/ui/searchhl_spec.lua219
3 files changed, 183 insertions, 117 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 22589fb107..e065a727f3 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -1848,8 +1848,7 @@ describe("'winhighlight' highlight", function()
]], unchanged=true}
end)
-
- it('works local to the buffer', function()
+ it('works local to the window', function()
insert("aa")
command("split")
command("setlocal winhl=Normal:Background1")
@@ -2240,4 +2239,35 @@ describe("'winhighlight' highlight", function()
|
]]}
end)
+
+ it('can override StatusLine and StatusLineNC', function()
+ command('set winhighlight=StatusLine:Background1,StatusLineNC:Background2')
+ command('split')
+ screen:expect([[
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {1:[No Name] }|
+ |
+ {0:~ }|
+ {5:[No Name] }|
+ |
+ ]])
+ end)
+
+ it('can override WinBar and WinBarNC #19345', function()
+ command('setlocal winbar=foobar')
+ command('set winhighlight=WinBar:Background1,WinBarNC:Background2')
+ command('split')
+ screen:expect([[
+ {1:foobar }|
+ ^ |
+ {0:~ }|
+ {3:[No Name] }|
+ {5:foobar }|
+ |
+ {4:[No Name] }|
+ |
+ ]])
+ end)
end)
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index e9c0e1b2a1..00f126a1f2 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1196,6 +1196,53 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{4:Press ENTER or type command to continue}^ |
]]}
end)
+
+ it('prints lines in Ex mode correctly with a burst of carriage returns #19341', function()
+ command('set number')
+ meths.buf_set_lines(0, 0, 0, true, {'aaa', 'bbb', 'ccc'})
+ command('set display-=msgsep')
+ feed('gggQ<CR><CR>1<CR><CR>vi')
+ screen:expect([[
+ Entering Ex mode. Type "visual" to go to Normal mode. |
+ {11: 2 }bbb |
+ {11: 3 }ccc |
+ :1 |
+ {11: 1 }aaa |
+ {11: 2 }bbb |
+ :vi^ |
+ ]])
+ feed('<CR>')
+ screen:expect([[
+ {11: 1 }aaa |
+ {11: 2 }^bbb |
+ {11: 3 }ccc |
+ {11: 4 } |
+ {1:~ }|
+ {1:~ }|
+ |
+ ]])
+ command('set display+=msgsep')
+ feed('gggQ<CR><CR>1<CR><CR>vi')
+ screen:expect([[
+ Entering Ex mode. Type "visual" to go to Normal mode. |
+ {11: 2 }bbb |
+ {11: 3 }ccc |
+ :1 |
+ {11: 1 }aaa |
+ {11: 2 }bbb |
+ :vi^ |
+ ]])
+ feed('<CR>')
+ screen:expect([[
+ {11: 1 }aaa |
+ {11: 2 }^bbb |
+ {11: 3 }ccc |
+ {11: 4 } |
+ {1:~ }|
+ {1:~ }|
+ |
+ ]])
+ end)
end)
describe('ui/ext_messages', function()
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index c3b9af5e72..c5c88323a2 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -5,6 +5,7 @@ local command = helpers.command
local feed_command = helpers.feed_command
local eq = helpers.eq
local eval = helpers.eval
+local funcs = helpers.funcs
local testprg = helpers.testprg
describe('search highlighting', function()
@@ -321,100 +322,101 @@ describe('search highlighting', function()
end)
it('works with incsearch', function()
- feed_command('set hlsearch')
- feed_command('set incsearch')
+ command('set hlsearch')
+ command('set incsearch')
+ command('set laststatus=0')
insert([[
the first line
- in a little file
- ]])
+ in a little file]])
+ command('vsplit')
feed("gg/li")
screen:expect([[
- the first {3:li}ne |
- in a {2:li}ttle file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first {3:li}ne │the first {2:li}ne |
+ in a {2:li}ttle file │in a {2:li}ttle file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/li^ |
]])
-- check that consecutive matches are caught by C-g/C-t
feed("<C-g>")
screen:expect([[
- the first {2:li}ne |
- in a {3:li}ttle file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first {2:li}ne │the first {2:li}ne |
+ in a {3:li}ttle file │in a {2:li}ttle file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/li^ |
]])
feed("<C-t>")
screen:expect([[
- the first {3:li}ne |
- in a {2:li}ttle file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first {3:li}ne │the first {2:li}ne |
+ in a {2:li}ttle file │in a {2:li}ttle file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/li^ |
]])
feed("t")
screen:expect([[
- the first line |
- in a {3:lit}tle file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first line │the first line |
+ in a {3:lit}tle file │in a {2:lit}tle file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/lit^ |
]])
feed("<cr>")
screen:expect([[
- the first line |
- in a {2:^lit}tle file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first line │the first line |
+ in a {2:^lit}tle file │in a {2:lit}tle file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/lit |
]])
feed("/fir")
screen:expect([[
- the {3:fir}st line |
- in a little file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the {3:fir}st line │the {2:fir}st line |
+ in a little file │in a little file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/fir^ |
]])
-- incsearch have priority over hlsearch
feed("<esc>/ttle")
screen:expect([[
- the first line |
- in a li{3:ttle} file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first line │the first line |
+ in a li{3:ttle} file │in a li{2:ttle} file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/ttle^ |
]])
-- cancelling search resets to the old search term
feed('<esc>')
screen:expect([[
- the first line |
- in a {2:^lit}tle file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first line │the first line |
+ in a {2:^lit}tle file │in a {2:lit}tle file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
|
]])
eq('lit', eval('@/'))
@@ -422,91 +424,78 @@ describe('search highlighting', function()
-- cancelling inc search restores the hl state
feed(':noh<cr>')
screen:expect([[
- the first line |
- in a ^little file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first line │the first line |
+ in a ^little file │in a little file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
:noh |
]])
feed('/first')
screen:expect([[
- the {3:first} line |
- in a little file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the {3:first} line │the {2:first} line |
+ in a little file │in a little file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
/first^ |
]])
feed('<esc>')
screen:expect([[
- the first line |
- in a ^little file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the first line │the first line |
+ in a ^little file │in a little file |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
|
]])
-- test that pressing C-g in an empty command line does not move the cursor
- feed('/<C-g>')
- screen:expect([[
- the first line |
- in a little file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- /^ |
- ]])
-
- -- same, for C-t
- feed('<ESC>')
- screen:expect([[
- the first line |
- in a ^little file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- |
- ]])
- feed('/<C-t>')
- screen:expect([[
- the first line |
- in a little file |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- /^ |
- ]])
+ feed('gg0')
+ command([[let @/ = 'i']])
+ -- moves to next match of previous search pattern, just like /<cr>
+ feed('/<c-g><cr>')
+ eq({0, 1, 6, 0}, funcs.getpos('.'))
+ -- moves to next match of previous search pattern, just like /<cr>
+ feed('/<cr>')
+ eq({0, 1, 12, 0}, funcs.getpos('.'))
+ -- moves to next match of previous search pattern, just like /<cr>
+ feed('/<c-t><cr>')
+ eq({0, 2, 1, 0}, funcs.getpos('.'))
-- 8.0.1304, test that C-g and C-t works with incsearch and empty pattern
feed('<esc>/fi<CR>')
+ screen:expect([[
+ the {2:fi}rst line │the {2:fi}rst line |
+ in a little {2:^fi}le │in a little {2:fi}le |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ /fi |
+ ]])
feed('//')
screen:expect([[
- the {3:fi}rst line |
- in a little {2:fi}le |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the {3:fi}rst line │the {2:fi}rst line |
+ in a little {2:fi}le │in a little {2:fi}le |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
//^ |
]])
-
feed('<C-g>')
screen:expect([[
- the {2:fi}rst line |
- in a little {3:fi}le |
- |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ the {2:fi}rst line │the {2:fi}rst line |
+ in a little {3:fi}le │in a little {2:fi}le |
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
+ {1:~ }│{1:~ }|
//^ |
]])
end)