aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
commitff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch)
tree729bbcb92231538fa61dab6c3d890b025484b7f5 /test/functional/ui
parent376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff)
parent28c04948a1c887a1cc0cb64de79fa32631700466 (diff)
downloadrneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/bufhl_spec.lua13
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua21
-rw-r--r--test/functional/ui/cmdline_spec.lua140
-rw-r--r--test/functional/ui/cursor_spec.lua24
-rw-r--r--test/functional/ui/decorations_spec.lua792
-rw-r--r--test/functional/ui/diff_spec.lua1251
-rw-r--r--test/functional/ui/embed_spec.lua72
-rw-r--r--test/functional/ui/float_spec.lua310
-rw-r--r--test/functional/ui/fold_spec.lua20
-rw-r--r--test/functional/ui/highlight_spec.lua1068
-rw-r--r--test/functional/ui/hlstate_spec.lua39
-rw-r--r--test/functional/ui/inccommand_spec.lua1064
-rw-r--r--test/functional/ui/inccommand_user_spec.lua135
-rw-r--r--test/functional/ui/input_spec.lua87
-rw-r--r--test/functional/ui/linematch_spec.lua1139
-rw-r--r--test/functional/ui/messages_spec.lua891
-rw-r--r--test/functional/ui/mode_spec.lua78
-rw-r--r--test/functional/ui/mouse_spec.lua76
-rw-r--r--test/functional/ui/multibyte_spec.lua90
-rw-r--r--test/functional/ui/multigrid_spec.lua170
-rw-r--r--test/functional/ui/options_spec.lua14
-rw-r--r--test/functional/ui/output_spec.lua103
-rw-r--r--test/functional/ui/popupmenu_spec.lua255
-rw-r--r--test/functional/ui/quickfix_spec.lua7
-rw-r--r--test/functional/ui/screen.lua119
-rw-r--r--test/functional/ui/screen_basic_spec.lua29
-rw-r--r--test/functional/ui/searchhl_spec.lua34
-rw-r--r--test/functional/ui/sign_spec.lua36
-rw-r--r--test/functional/ui/spell_spec.lua16
-rw-r--r--test/functional/ui/statuscolumn_spec.lua447
-rw-r--r--test/functional/ui/statusline_spec.lua86
-rw-r--r--test/functional/ui/syntax_conceal_spec.lua26
-rw-r--r--test/functional/ui/tabline_spec.lua50
-rw-r--r--test/functional/ui/title_spec.lua22
-rw-r--r--test/functional/ui/wildmode_spec.lua130
-rw-r--r--test/functional/ui/winbar_spec.lua63
36 files changed, 5025 insertions, 3892 deletions
diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua
index 896f75a681..5590db5bc4 100644
--- a/test/functional/ui/bufhl_spec.lua
+++ b/test/functional/ui/bufhl_spec.lua
@@ -1,11 +1,12 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command, neq = helpers.command, helpers.neq
-local api = helpers.api
-local eq = helpers.eq
-local pcall_err = helpers.pcall_err
+local clear, feed, insert = n.clear, n.feed, n.insert
+local command, neq = n.command, t.neq
+local api = n.api
+local eq = t.eq
+local pcall_err = t.pcall_err
local set_virtual_text = api.nvim_buf_set_virtual_text
describe('Buffer highlighting', function()
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index 6c4000ba41..1c6f19245a 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -1,15 +1,16 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local eq = helpers.eq
-local feed = helpers.feed
-local clear = helpers.clear
-local api = helpers.api
-local fn = helpers.fn
-local source = helpers.source
-local exec_capture = helpers.exec_capture
-local dedent = helpers.dedent
-local command = helpers.command
+local eq = t.eq
+local feed = n.feed
+local clear = n.clear
+local api = n.api
+local fn = n.fn
+local source = n.source
+local exec_capture = n.exec_capture
+local dedent = t.dedent
+local command = n.command
local screen
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 0eb5770819..6edfb4a49c 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -1,15 +1,17 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed = helpers.clear, helpers.feed
-local source = helpers.source
-local command = helpers.command
-local assert_alive = helpers.assert_alive
-local poke_eventloop = helpers.poke_eventloop
-local exec = helpers.exec
-local eval = helpers.eval
-local eq = helpers.eq
-local is_os = helpers.is_os
-local api = helpers.api
+
+local clear, feed = n.clear, n.feed
+local source = n.source
+local command = n.command
+local assert_alive = n.assert_alive
+local poke_eventloop = n.poke_eventloop
+local exec = n.exec
+local eval = n.eval
+local eq = t.eq
+local is_os = t.is_os
+local api = n.api
local function new_screen(opt)
local screen = Screen.new(25, 5)
@@ -365,7 +367,7 @@ local function test_cmdline(linegrid)
grid = [[
|
{2:[No Name] }|
- {1::}mak^e |
+ {1::}make^ |
{3:[Command Line] }|
|
]],
@@ -377,7 +379,7 @@ local function test_cmdline(linegrid)
grid = [[
|
{2:[No Name] }|
- {1::}mak^e |
+ {1::}make^ |
{3:[Command Line] }|
|
]],
@@ -396,7 +398,7 @@ local function test_cmdline(linegrid)
grid = [[
|
{2:[No Name] }|
- {1::}mak^e |
+ {1::}make^ |
{3:[Command Line] }|
|
]],
@@ -416,7 +418,7 @@ local function test_cmdline(linegrid)
grid = [[
|
{2:[No Name] }|
- {1::}mak^e |
+ {1::}make^ |
{3:[Command Line] }|
|
]],
@@ -824,6 +826,30 @@ local function test_cmdline(linegrid)
|
]])
end)
+
+ it('does not move cursor to curwin #20309', function()
+ local win = api.nvim_get_current_win()
+ command('norm icmdlinewin')
+ command('new')
+ command('norm icurwin')
+ feed(':')
+ api.nvim_win_set_cursor(win, { 1, 7 })
+ api.nvim__redraw({ win = win, cursor = true })
+ screen:expect {
+ grid = [[
+ curwin |
+ {3:[No Name] [+] }|
+ cmdline^win |
+ {2:[No Name] [+] }|
+ |
+ ]],
+ cmdline = { {
+ content = { { '' } },
+ firstc = ':',
+ pos = 0,
+ } },
+ }
+ end)
end
-- the representation of cmdline and cmdline_block contents changed with ext_linegrid
@@ -1242,15 +1268,6 @@ describe('cmdheight=0', function()
before_each(function()
clear()
screen = Screen.new(25, 5)
- screen:set_default_attr_ids {
- [1] = { bold = true, foreground = Screen.colors.Blue },
- [2] = { bold = true, reverse = true },
- [3] = { bold = true },
- [4] = { foreground = Screen.colors.White, background = Screen.colors.Red },
- [5] = { foreground = Screen.colors.SeaGreen4, bold = true },
- [6] = { reverse = true },
- [7] = { background = Screen.colors.Yellow },
- }
screen:attach()
end)
@@ -1279,7 +1296,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*2
- {2:[No Name] }|
+ {3:[No Name] }|
|
]],
}
@@ -1291,7 +1308,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*3
- {2:[No Name] }|
+ {3:[No Name] }|
]],
}
end)
@@ -1341,7 +1358,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*3
- {3:-- INSERT --} |
+ {5:-- INSERT --} |
]],
}
feed('<Esc>')
@@ -1377,7 +1394,7 @@ describe('cmdheight=0', function()
grid = [[
|
{1:~ }|
- {2: }|
+ {3: }|
:call input("foo >") |
foo >^ |
]],
@@ -1399,26 +1416,26 @@ describe('cmdheight=0', function()
feed(':split<CR>')
screen:expect {
grid = [[
- {2: }|
+ {3: }|
:split |
- {4:E36: Not enough room} |
- {5:Press ENTER or type comma}|
- {5:nd to continue}^ |
+ {9:E36: Not enough room} |
+ {6:Press ENTER or type comma}|
+ {6:nd to continue}^ |
]],
}
feed('<CR>')
screen:expect {
grid = [[
- {3:foo }|
+ {5:foo }|
^ |
{1:~ }|*2
- {2:[No Name] }|
+ {3:[No Name] }|
]],
}
feed(':')
screen:expect {
grid = [[
- {3:foo }|
+ {5:foo }|
|
{1:~ }|*2
:^ |
@@ -1427,10 +1444,10 @@ describe('cmdheight=0', function()
feed('<Esc>')
screen:expect {
grid = [[
- {3:foo }|
+ {5:foo }|
^ |
{1:~ }|*2
- {2:[No Name] }|
+ {3:[No Name] }|
]],
showmode = {},
}
@@ -1465,16 +1482,16 @@ describe('cmdheight=0', function()
grid = [[
fo^o |
{1:~ }|*3
- {2:[No Name] [+] }|
+ {3:[No Name] [+] }|
]],
}
feed(':%s/foo/bar/gc<CR>')
screen:expect {
grid = [[
- {6:foo} |
+ {2:foo} |
{1:~ }|*3
- {5:replace wi...q/l/^E/^Y)?}^ |
+ {6:replace wi...q/l/^E/^Y)?}^ |
]],
}
@@ -1483,7 +1500,7 @@ describe('cmdheight=0', function()
grid = [[
^bar |
{1:~ }|*3
- {2:[No Name] [+] }|
+ {3:[No Name] [+] }|
]],
}
@@ -1502,7 +1519,7 @@ describe('cmdheight=0', function()
feed('iaabbaa<esc>/aa<cr>')
screen:expect {
grid = [[
- {7:^aa}bb{7:aa} |
+ {10:^aa}bb{10:aa} |
{1:~ }|*4
]],
}
@@ -1561,7 +1578,7 @@ describe('cmdheight=0', function()
[2:-------------------------]|*4
[3:-------------------------]|
## grid 2
- {6:p} |
+ {2:p} |
{1:~ }|*4
## grid 3
/p^ |
@@ -1572,7 +1589,7 @@ describe('cmdheight=0', function()
topline = 0,
botline = 2,
curline = 0,
- curcol = 0,
+ curcol = 1,
linecount = 1,
sum_scroll_delta = 0,
},
@@ -1587,7 +1604,7 @@ describe('cmdheight=0', function()
]])
feed(':')
screen:expect([[
- {3:c :}|
+ {5:c :}|
|
{1:~ }|*2
:^ |
@@ -1595,14 +1612,14 @@ describe('cmdheight=0', function()
feed('echo')
-- not redrawn yet
screen:expect([[
- {3:c :}|
+ {5:c :}|
|
{1:~ }|*2
:echo^ |
]])
command('redrawstatus')
screen:expect([[
- {3:c :echo}|
+ {5:c :echo}|
|
{1:~ }|*2
:echo^ |
@@ -1623,7 +1640,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ │ |
{1:~ }│{1:~ }|*3
- {2:[No Name] }│{1:~ }|
+ {3:[No Name] }│{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|*3
]])
@@ -1631,7 +1648,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ │ |
{1:~ }│{1:~ }|
- {2:[No Name] }│{1:~ }|
+ {3:[No Name] }│{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|*5
]])
@@ -1641,7 +1658,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ │ |
{1:~ }│{1:~ }|*3
- {2:[No Name] }│{1:~ }|
+ {3:[No Name] }│{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|*3
]])
@@ -1663,7 +1680,7 @@ describe('cmdheight=0', function()
screen:expect([[
^ |
{1:~ }|*2
- {2:[No Name] }|
+ {3:[No Name] }|
|
]])
command('set cmdheight=0')
@@ -1671,7 +1688,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*3
- {2:[No Name] }|
+ {3:[No Name] }|
]],
}
command('resize -1')
@@ -1679,7 +1696,7 @@ describe('cmdheight=0', function()
grid = [[
^ |
{1:~ }|*2
- {2:[No Name] }|
+ {3:[No Name] }|
|
]],
}
@@ -1687,23 +1704,28 @@ describe('cmdheight=0', function()
screen:expect([[
^ |
{1:~ }|*3
- {2:[No Name] }|
+ {3:[No Name] }|
]])
end)
- it('cannot be resized at all with external messages', function()
+ it('can be resized with external messages', function()
clear()
screen = new_screen({ rgb = true, ext_messages = true })
command('set laststatus=2 mouse=a')
command('resize -1')
screen:expect([[
^ |
- {1:~ }|*3
+ {1:~ }|*2
{3:[No Name] }|
+ |
]])
- api.nvim_input_mouse('left', 'press', '', 0, 6, 10)
+ api.nvim_input_mouse('left', 'press', '', 0, 3, 10)
poke_eventloop()
- api.nvim_input_mouse('left', 'drag', '', 0, 5, 10)
- screen:expect_unchanged()
+ api.nvim_input_mouse('left', 'drag', '', 0, 4, 10)
+ screen:expect([[
+ ^ |
+ {1:~ }|*3
+ {3:[No Name] }|
+ ]])
end)
end)
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua
index 871e9a0790..8bfceb8cce 100644
--- a/test/functional/ui/cursor_spec.lua
+++ b/test/functional/ui/cursor_spec.lua
@@ -1,8 +1,10 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, api = helpers.clear, helpers.api
-local eq = helpers.eq
-local command = helpers.command
+
+local clear, api = n.clear, n.api
+local eq = t.eq
+local command = n.command
describe('ui/cursor', function()
local screen
@@ -204,7 +206,7 @@ describe('ui/cursor', function()
screen:expect {
grid = [[
^ |
- ~ |*3
+ {1:~ }|*3
test |
]],
condition = function()
@@ -213,8 +215,8 @@ describe('ui/cursor', function()
}
-- Change the cursor style.
- helpers.command('hi Cursor guibg=DarkGray')
- helpers.command(
+ n.command('hi Cursor guibg=DarkGray')
+ n.command(
'set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr-o:hor20'
.. ',a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor'
.. ',sm:block-blinkwait175-blinkoff150-blinkon175'
@@ -260,8 +262,8 @@ describe('ui/cursor', function()
end)
-- Change hl groups only, should update the styles
- helpers.command('hi Cursor guibg=Red')
- helpers.command('hi lCursor guibg=Green')
+ n.command('hi Cursor guibg=Red')
+ n.command('hi lCursor guibg=Green')
-- Update the expected values.
for _, m in ipairs(expected_mode_info) do
@@ -280,7 +282,7 @@ describe('ui/cursor', function()
end)
-- update the highlight again to hide cursor
- helpers.command('hi Cursor blend=100')
+ n.command('hi Cursor blend=100')
for _, m in ipairs(expected_mode_info) do
if m.hl_id then
@@ -290,7 +292,7 @@ describe('ui/cursor', function()
screen:expect {
grid = [[
^ |
- ~ |*3
+ {1:~ }|*3
test |
]],
condition = function()
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index e57e719192..746bfb3262 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1,18 +1,19 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local feed = helpers.feed
-local insert = helpers.insert
-local exec_lua = helpers.exec_lua
-local exec = helpers.exec
-local expect_events = helpers.expect_events
-local api = helpers.api
-local fn = helpers.fn
-local command = helpers.command
-local eq = helpers.eq
-local assert_alive = helpers.assert_alive
-local pcall_err = helpers.pcall_err
+local clear = n.clear
+local feed = n.feed
+local insert = n.insert
+local exec_lua = n.exec_lua
+local exec = n.exec
+local expect_events = t.expect_events
+local api = n.api
+local fn = n.fn
+local command = n.command
+local eq = t.eq
+local assert_alive = n.assert_alive
+local pcall_err = t.pcall_err
describe('decorations providers', function()
local screen
@@ -667,6 +668,33 @@ describe('decorations providers', function()
]])
end)
+ it('on_line is invoked only for buffer lines', function()
+ insert(mulholland)
+ command('vnew')
+ insert(mulholland)
+ feed('dd')
+ command('windo diffthis')
+
+ exec_lua([[
+ out_of_bound = false
+ ]])
+ setup_provider([[
+ local function on_do(kind, _, bufnr, row)
+ if kind == 'line' then
+ if not api.nvim_buf_get_lines(bufnr, row, row + 1, false)[1] then
+ out_of_bound = true
+ end
+ end
+ end
+ ]])
+
+ feed('<C-e>')
+
+ exec_lua([[
+ assert(out_of_bound == false)
+ ]])
+ end)
+
it('errors gracefully', function()
insert(mulholland)
@@ -696,48 +724,7 @@ describe('decorations providers', function()
end
]]
- helpers.assert_alive()
- end)
-
- it('supports subpriorities (order of definitions in a query file #27131)', function()
- insert(mulholland)
- setup_provider [[
- local test_ns = api.nvim_create_namespace('mulholland')
- function on_do(event, ...)
- if event == "line" then
- local win, buf, line = ...
- api.nvim_buf_set_extmark(buf, test_ns, line, 0, {
- end_row = line + 1,
- hl_eol = true,
- hl_group = 'Comment',
- ephemeral = true,
- priority = 100,
- _subpriority = 20,
- })
-
- -- This extmark is set last but has a lower subpriority, so the first extmark "wins"
- api.nvim_buf_set_extmark(buf, test_ns, line, 0, {
- end_row = line + 1,
- hl_eol = true,
- hl_group = 'String',
- ephemeral = true,
- priority = 100,
- _subpriority = 10,
- })
- end
- end
- ]]
-
- screen:expect{grid=[[
- {4:// just to see if there was an accident }|
- {4:// on Mulholland Drive }|
- {4:try_start(); }|
- {4:bufref_T save_buf; }|
- {4:switch_buffer(&save_buf, buf); }|
- {4:posp = getmark(mark, false); }|
- {4:restore_buffer(&save_buf);^ }|
- |
- ]]}
+ n.assert_alive()
end)
it('is not invoked repeatedly in Visual mode with vim.schedule() #20235', function()
@@ -2301,8 +2288,21 @@ describe('extmark decorations', function()
]]}
end)
+ it('virtual text does not crash with blend, conceal and wrap #27836', function()
+ screen:try_resize(50, 3)
+ insert(('a'):rep(45) .. '|hidden|' .. ('b'):rep(45))
+ command('syntax match test /|hidden|/ conceal')
+ command('set conceallevel=2 concealcursor=n')
+ api.nvim_buf_set_extmark(0, ns, 0, 0, {virt_text = {{'FOO'}}, virt_text_pos='right_align', hl_mode='blend'})
+ screen:expect{grid=[[
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa FOO|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb^b |
+ |
+ ]]}
+ end)
+
it('works with both hl_group and sign_hl_group', function()
- screen:try_resize(screen._width, 3)
+ screen:try_resize(50, 3)
insert('abcdefghijklmn')
api.nvim_buf_set_extmark(0, ns, 0, 0, {sign_text='S', sign_hl_group='NonText', hl_group='Error', end_col=14})
screen:expect{grid=[[
@@ -2343,10 +2343,9 @@ describe('extmark decorations', function()
local url = 'https://example.com'
- screen:set_default_attr_ids({
- e = { bold = true, foreground = Screen.colors.Blue },
- u = { url = url },
- })
+ screen:add_extra_attr_ids {
+ u = { url = "https://example.com" },
+ }
api.nvim_buf_set_extmark(0, ns, 1, 4, {
end_col = 14,
@@ -2366,8 +2365,8 @@ describe('extmark decorations', function()
colpos = colpos+1 |
end |
en^d |
- {e:~ }|
- {e:~ }|
+ {1:~ }|
+ {1:~ }|
|
]]}
end)
@@ -2399,7 +2398,7 @@ describe('extmark decorations', function()
|
]]}
- helpers.assert_alive()
+ n.assert_alive()
end)
it('priority ordering of overlay or win_col virtual text at same position', function()
@@ -4042,16 +4041,8 @@ describe('decorations: virtual lines', function()
clear()
screen = Screen.new(50, 12)
screen:attach()
- screen:set_default_attr_ids {
- [1] = {bold=true, foreground=Screen.colors.Blue};
- [2] = {foreground = Screen.colors.DarkCyan};
- [3] = {background = Screen.colors.Yellow1};
- [4] = {bold = true};
- [5] = {background = Screen.colors.Yellow, foreground = Screen.colors.Blue};
- [6] = {foreground = Screen.colors.Blue};
- [7] = {foreground = Screen.colors.SlateBlue};
- [8] = {background = Screen.colors.WebGray, foreground = Screen.colors.DarkBlue};
- [9] = {foreground = Screen.colors.Brown};
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Blue, background = Screen.colors.Yellow },
}
ns = api.nvim_create_namespace 'test'
@@ -4092,7 +4083,7 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
- {1:>> }{2:krealloc}: change the size of an allocation |
+ {1:>> }{25:krealloc}: change the size of an allocation |
^khkey_t *new_keys = (khkey_t *)krealloc((void *)|
h->keys, new_n_buckets * sizeof(khkey_t)); |
h->keys = new_keys; |
@@ -4108,12 +4099,12 @@ if (h->n_buckets < new_n_buckets) { // expand
feed '/krealloc<cr>'
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
- {1:>> }{2:krealloc}: change the size of an allocation |
- khkey_t *new_keys = (khkey_t *){3:^krealloc}((void *)|
+ {1:>> }{25:krealloc}: change the size of an allocation |
+ khkey_t *new_keys = (khkey_t *){10:^krealloc}((void *)|
h->keys, new_n_buckets * sizeof(khkey_t)); |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
- char *new_vals = {3:krealloc}( h->vals_buf, new_n_|
+ char *new_vals = {10:krealloc}( h->vals_buf, new_n_|
buckets * val_size); |
h->vals_buf = new_vals; |
} |
@@ -4126,28 +4117,28 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *) |
- {1:>> }{2:krealloc}: change the size of an allocation |
- {3:^krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
+ {1:>> }{25:krealloc}: change the size of an allocation |
+ {10:^krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
hkey_t)); |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
- char *new_vals = {3:krealloc}( h->vals_buf, new_n_|
+ char *new_vals = {10:krealloc}( h->vals_buf, new_n_|
buckets * val_size); |
h->vals_buf = new_vals; |
} |
- {4:-- INSERT --} |
+ {5:-- INSERT --} |
]]}
feed '<esc>3+'
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *) |
- {1:>> }{2:krealloc}: change the size of an allocation |
- {3:krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
+ {1:>> }{25:krealloc}: change the size of an allocation |
+ {10:krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
hkey_t)); |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
- ^char *new_vals = {3:krealloc}( h->vals_buf, new_n_|
+ ^char *new_vals = {10:krealloc}( h->vals_buf, new_n_|
buckets * val_size); |
h->vals_buf = new_vals; |
} |
@@ -4160,14 +4151,14 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *) |
- {1:>> }{2:krealloc}: change the size of an allocation |
- {3:krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
+ {1:>> }{25:krealloc}: change the size of an allocation |
+ {10:krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
hkey_t)); |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
- ^char *new_vals = {3:krealloc}( h->vals_buf, new_n_|
+ ^char *new_vals = {10:krealloc}( h->vals_buf, new_n_|
buckets * val_size); |
- {5:^^ REVIEW:}{6: new_vals variable seems unnecessary?} |
+ {100:^^ REVIEW:}{18: new_vals variable seems unnecessary?} |
h->vals_buf = new_vals; |
|
]]}
@@ -4176,11 +4167,11 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *) |
- {3:krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
+ {10:krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
hkey_t)); |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
- ^char *new_vals = {3:krealloc}( h->vals_buf, new_n_|
+ ^char *new_vals = {10:krealloc}( h->vals_buf, new_n_|
buckets * val_size); |
h->vals_buf = new_vals; |
} |
@@ -4235,9 +4226,9 @@ if (h->n_buckets < new_n_buckets) { // expand
feed '<c-b>'
screen:expect{grid=[[
- {7:refactor(khash): }take size of values as parameter |
- Author: Dev Devsson, {6:Tue Aug 31 10:13:37 2021} |
- ^if (h->n_buckets < new_n_buckets) { // expand |
+ {16:refactor(khash): }take size of values as parameter |
+ Author: Dev Devsson, {18:Tue Aug 31 10:13:37 2021} |
+ if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *)krealloc((void *)|
h->keys, new_n_buckets * sizeof(khkey_t)); |
h->keys = new_keys; |
@@ -4245,7 +4236,7 @@ if (h->n_buckets < new_n_buckets) { // expand
char *new_vals = krealloc( h->vals_buf, new_n_|
buckets * val_size); |
h->vals_buf = new_vals; |
- } |
+ ^} |
|
]]}
end)
@@ -4461,7 +4452,7 @@ if (h->n_buckets < new_n_buckets) { // expand
api.nvim_buf_set_extmark(0, ns, 0, 0, {virt_lines = {{{'bar', 'Comment'}}}})
screen:expect([[
fo^o |
- {6:bar} |
+ {18:bar} |
{1:~ }|*9
|
]])
@@ -4520,7 +4511,7 @@ if (h->n_buckets < new_n_buckets) { // expand
ff |
gg |
they see me |
- {7:scrolling} |
+ {16:scrolling} |
|
]]}
@@ -4530,7 +4521,7 @@ if (h->n_buckets < new_n_buckets) { // expand
ff |
gg |
they see me |
- {7:scrolling} |
+ {16:scrolling} |
they |
|
]]}
@@ -4540,9 +4531,9 @@ if (h->n_buckets < new_n_buckets) { // expand
^ff |
gg |
they see me |
- {7:scrolling} |
+ {16:scrolling} |
they |
- {7:hatin'} |
+ {16:hatin'} |
|
]]}
@@ -4550,9 +4541,9 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
^gg |
they see me |
- {7:scrolling} |
+ {16:scrolling} |
they |
- {7:hatin'} |
+ {16:hatin'} |
hh |
|
]]}
@@ -4560,9 +4551,9 @@ if (h->n_buckets < new_n_buckets) { // expand
feed '<c-e>'
screen:expect{grid=[[
they see me |
- {7:scrolling} |
+ {16:scrolling} |
they |
- {7:hatin'} |
+ {16:hatin'} |
^hh |
{1:~ }|
|
@@ -4570,9 +4561,9 @@ if (h->n_buckets < new_n_buckets) { // expand
feed '<c-e>'
screen:expect{grid=[[
- {7:scrolling} |
+ {16:scrolling} |
they |
- {7:hatin'} |
+ {16:hatin'} |
^hh |
{1:~ }|*2
|
@@ -4581,7 +4572,7 @@ if (h->n_buckets < new_n_buckets) { // expand
feed '<c-e>'
screen:expect{grid=[[
they |
- {7:hatin'} |
+ {16:hatin'} |
^hh |
{1:~ }|*3
|
@@ -4589,7 +4580,7 @@ if (h->n_buckets < new_n_buckets) { // expand
feed '<c-e>'
screen:expect{grid=[[
- {7:hatin'} |
+ {16:hatin'} |
^hh |
{1:~ }|*4
|
@@ -4608,17 +4599,17 @@ if (h->n_buckets < new_n_buckets) { // expand
feed 'gg'
command 'set number signcolumn=yes'
screen:expect{grid=[[
- {8: }{9: 1 }^if (h->n_buckets < new_n_buckets) { // expan|
- {8: }{9: }d |
- {8: }{9: 2 } khkey_t *new_keys = (khkey_t *)krealloc((v|
- {8: }{9: }oid *)h->keys, new_n_buckets * sizeof(khkey_|
- {8: }{9: }t)); |
- {8: }{9: 3 } h->keys = new_keys; |
- {8: }{9: 4 } if (kh_is_map && val_size) { |
- {8: }{9: 5 } char *new_vals = krealloc( h->vals_buf, |
- {8: }{9: }new_n_buckets * val_size); |
- {8: }{9: 6 } h->vals_buf = new_vals; |
- {8: }{9: 7 } } |
+ {7: }{8: 1 }^if (h->n_buckets < new_n_buckets) { // expan|
+ {7: }{8: }d |
+ {7: }{8: 2 } khkey_t *new_keys = (khkey_t *)krealloc((v|
+ {7: }{8: }oid *)h->keys, new_n_buckets * sizeof(khkey_|
+ {7: }{8: }t)); |
+ {7: }{8: 3 } h->keys = new_keys; |
+ {7: }{8: 4 } if (kh_is_map && val_size) { |
+ {7: }{8: 5 } char *new_vals = krealloc( h->vals_buf, |
+ {7: }{8: }new_n_buckets * val_size); |
+ {7: }{8: 6 } h->vals_buf = new_vals; |
+ {7: }{8: 7 } } |
|
]]}
@@ -4630,17 +4621,17 @@ if (h->n_buckets < new_n_buckets) { // expand
})
screen:expect{grid=[[
- {8: }{9: 1 }^if (h->n_buckets < new_n_buckets) { // expan|
- {8: }{9: }d |
- {8: }{9: 2 } khkey_t *new_keys = (khkey_t *)krealloc((v|
- {8: }{9: }oid *)h->keys, new_n_buckets * sizeof(khkey_|
- {8: }{9: }t)); |
- {8: }{9: 3 } h->keys = new_keys; |
- {8: }{9: }{7:Some special} |
- {8: }{9: }{6:remark about codes} |
- {8: }{9: 4 } if (kh_is_map && val_size) { |
- {8: }{9: 5 } char *new_vals = krealloc( h->vals_buf, |
- {8: }{9: }new_n_buckets * val_size); |
+ {7: }{8: 1 }^if (h->n_buckets < new_n_buckets) { // expan|
+ {7: }{8: }d |
+ {7: }{8: 2 } khkey_t *new_keys = (khkey_t *)krealloc((v|
+ {7: }{8: }oid *)h->keys, new_n_buckets * sizeof(khkey_|
+ {7: }{8: }t)); |
+ {7: }{8: 3 } h->keys = new_keys; |
+ {7: }{8: }{16:Some special} |
+ {7: }{8: }{18:remark about codes} |
+ {7: }{8: 4 } if (kh_is_map && val_size) { |
+ {7: }{8: 5 } char *new_vals = krealloc( h->vals_buf, |
+ {7: }{8: }new_n_buckets * val_size); |
|
]]}
@@ -4653,17 +4644,17 @@ if (h->n_buckets < new_n_buckets) { // expand
id=markid;
})
screen:expect{grid=[[
- {8: }{9: 1 }^if (h->n_buckets < new_n_buckets) { // expan|
- {8: }{9: }d |
- {8: }{9: 2 } khkey_t *new_keys = (khkey_t *)krealloc((v|
- {8: }{9: }oid *)h->keys, new_n_buckets * sizeof(khkey_|
- {8: }{9: }t)); |
- {8: }{9: 3 } h->keys = new_keys; |
- {7:Some special} |
- {6:remark about codes} |
- {8: }{9: 4 } if (kh_is_map && val_size) { |
- {8: }{9: 5 } char *new_vals = krealloc( h->vals_buf, |
- {8: }{9: }new_n_buckets * val_size); |
+ {7: }{8: 1 }^if (h->n_buckets < new_n_buckets) { // expan|
+ {7: }{8: }d |
+ {7: }{8: 2 } khkey_t *new_keys = (khkey_t *)krealloc((v|
+ {7: }{8: }oid *)h->keys, new_n_buckets * sizeof(khkey_|
+ {7: }{8: }t)); |
+ {7: }{8: 3 } h->keys = new_keys; |
+ {16:Some special} |
+ {18:remark about codes} |
+ {7: }{8: 4 } if (kh_is_map && val_size) { |
+ {7: }{8: 5 } char *new_vals = krealloc( h->vals_buf, |
+ {7: }{8: }new_n_buckets * val_size); |
|
]]}
end)
@@ -4679,7 +4670,7 @@ if (h->n_buckets < new_n_buckets) { // expand
^if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *)krealloc((void *)|
h->keys, new_n_buckets * sizeof(khkey_t)); |
- {1:>>}{2: very tabby}text with tabs |
+ {1:>>}{25: very tabby}text with tabs |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
char *new_vals = krealloc( h->vals_buf, new_n_|
@@ -4695,7 +4686,7 @@ if (h->n_buckets < new_n_buckets) { // expand
^if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *)krealloc((void *)|
h->keys, new_n_buckets * sizeof(khkey_t)); |
- {1:>>}{2: very tabby}text with tabs |
+ {1:>>}{25: very tabby}text with tabs |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
char *new_vals = krealloc( h->vals_buf, new_n_|
@@ -4708,33 +4699,33 @@ if (h->n_buckets < new_n_buckets) { // expand
command 'set number'
screen:expect{grid=[[
- {9: 1 }^if (h->n_buckets < new_n_buckets) { // expand |
- {9: 2 } khkey_t *new_keys = (khkey_t *)krealloc((voi|
- {9: }d *)h->keys, new_n_buckets * sizeof(khkey_t));|
- {9: }{1:>>}{2: very tabby}text with tabs |
- {9: 3 } h->keys = new_keys; |
- {9: 4 } if (kh_is_map && val_size) { |
- {9: 5 } char *new_vals = krealloc( h->vals_buf, ne|
- {9: }w_n_buckets * val_size); |
- {9: 6 } h->vals_buf = new_vals; |
- {9: 7 } } |
- {9: 8 }} |
+ {8: 1 }^if (h->n_buckets < new_n_buckets) { // expand |
+ {8: 2 } khkey_t *new_keys = (khkey_t *)krealloc((voi|
+ {8: }d *)h->keys, new_n_buckets * sizeof(khkey_t));|
+ {8: }{1:>>}{25: very tabby}text with tabs |
+ {8: 3 } h->keys = new_keys; |
+ {8: 4 } if (kh_is_map && val_size) { |
+ {8: 5 } char *new_vals = krealloc( h->vals_buf, ne|
+ {8: }w_n_buckets * val_size); |
+ {8: 6 } h->vals_buf = new_vals; |
+ {8: 7 } } |
+ {8: 8 }} |
|
]]}
command 'set tabstop&'
screen:expect{grid=[[
- {9: 1 }^if (h->n_buckets < new_n_buckets) { // expand |
- {9: 2 } khkey_t *new_keys = (khkey_t *)krealloc((voi|
- {9: }d *)h->keys, new_n_buckets * sizeof(khkey_t));|
- {9: }{1:>>}{2: very tabby}text with tabs |
- {9: 3 } h->keys = new_keys; |
- {9: 4 } if (kh_is_map && val_size) { |
- {9: 5 } char *new_vals = krealloc( h->vals_buf, ne|
- {9: }w_n_buckets * val_size); |
- {9: 6 } h->vals_buf = new_vals; |
- {9: 7 } } |
- {9: 8 }} |
+ {8: 1 }^if (h->n_buckets < new_n_buckets) { // expand |
+ {8: 2 } khkey_t *new_keys = (khkey_t *)krealloc((voi|
+ {8: }d *)h->keys, new_n_buckets * sizeof(khkey_t));|
+ {8: }{1:>>}{25: very tabby}text with tabs |
+ {8: 3 } h->keys = new_keys; |
+ {8: 4 } if (kh_is_map && val_size) { |
+ {8: 5 } char *new_vals = krealloc( h->vals_buf, ne|
+ {8: }w_n_buckets * val_size); |
+ {8: 6 } h->vals_buf = new_vals; |
+ {8: 7 } } |
+ {8: 8 }} |
|
]]}
end)
@@ -4771,12 +4762,12 @@ if (h->n_buckets < new_n_buckets) { // expand
api.nvim_buf_set_extmark(0, ns, 0, 0, {virt_lines = {{{'VIRT LINE 1', 'NonText'}}}, virt_lines_leftcol = true})
api.nvim_buf_set_extmark(0, ns, 3, 0, {virt_lines = {{{'VIRT LINE 2', 'NonText'}}}})
screen:expect{grid=[[
- aaa{9: 1 }|
+ aaa{8: 1 }|
{1:1 ENIL TRIV}|
- bbb{9: 2 }|
- ccc{9: 3 }|
- ^ddd{9: 4 }|
- {1:2 ENIL TRIV}{9: }|
+ bbb{8: 2 }|
+ ccc{8: 3 }|
+ ^ddd{8: 4 }|
+ {1:2 ENIL TRIV}{8: }|
{1: ~}|
|
]]}
@@ -4847,6 +4838,104 @@ if (h->n_buckets < new_n_buckets) { // expand
]])
end)
+ it('does not break cursor position with concealcursor #27887', function()
+ command('vsplit')
+ insert('\n')
+ api.nvim_set_option_value('conceallevel', 2, {})
+ api.nvim_set_option_value('concealcursor', 'niv', {})
+ api.nvim_buf_set_extmark(0, ns, 0, 0, { virt_lines = {{{'VIRT1'}}, {{'VIRT2'}}} })
+ screen:expect([[
+ │ |
+ VIRT1 │VIRT1 |
+ VIRT2 │VIRT2 |
+ ^ │ |
+ {1:~ }│{1:~ }|*6
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]])
+ end)
+
+ it('works with full page scrolling #28290', function()
+ screen:try_resize(20, 8)
+ command('call setline(1, range(20))')
+ api.nvim_buf_set_extmark(0, ns, 10, 0, { virt_lines = {{{'VIRT1'}}, {{'VIRT2'}}} })
+ screen:expect([[
+ ^0 |
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+ 5 |
+ 6 |
+ |
+ ]])
+ feed('<C-F>')
+ screen:expect([[
+ ^5 |
+ 6 |
+ 7 |
+ 8 |
+ 9 |
+ 10 |
+ VIRT1 |
+ |
+ ]])
+ feed('<C-F>')
+ screen:expect([[
+ ^10 |
+ VIRT1 |
+ VIRT2 |
+ 11 |
+ 12 |
+ 13 |
+ 14 |
+ |
+ ]])
+ feed('<C-F>')
+ screen:expect([[
+ ^13 |
+ 14 |
+ 15 |
+ 16 |
+ 17 |
+ 18 |
+ 19 |
+ |
+ ]])
+ feed('<C-B>')
+ screen:expect([[
+ 10 |
+ VIRT1 |
+ VIRT2 |
+ 11 |
+ 12 |
+ 13 |
+ ^14 |
+ |
+ ]])
+ feed('<C-B>')
+ screen:expect([[
+ 5 |
+ 6 |
+ 7 |
+ 8 |
+ 9 |
+ ^10 |
+ VIRT1 |
+ |
+ ]])
+ feed('<C-B>')
+ screen:expect([[
+ 0 |
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+ 5 |
+ ^6 |
+ |
+ ]])
+ end)
end)
describe('decorations: signs', function()
@@ -4855,11 +4944,8 @@ describe('decorations: signs', function()
clear()
screen = Screen.new(50, 10)
screen:attach()
- screen:set_default_attr_ids {
- [1] = {foreground = Screen.colors.Blue4, background = Screen.colors.Grey};
- [2] = {foreground = Screen.colors.Blue1, bold = true};
- [3] = {background = Screen.colors.Yellow1, foreground = Screen.colors.Blue1};
- [4] = {foreground = Screen.colors.Gray100, background = Screen.colors.Red};
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Blue, background = Screen.colors.Yellow },
}
ns = api.nvim_create_namespace 'test'
@@ -4881,13 +4967,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S'})
screen:expect{grid=[[
- {1: }^l1 |
+ {7: }^l1 |
S l2 |
- {1: }l3 |
- {1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ {7: }l3 |
+ {7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -4899,13 +4985,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S', end_row=1})
screen:expect{grid=[[
- {1: }^l1 |
+ {7: }^l1 |
S l2 |
- {1: }l3 |
- {1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ {7: }l3 |
+ {7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -4916,13 +5002,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text='S', hl_group='Todo', end_col=1})
screen:expect{grid=[[
- {1: }^l1 |
- S {3:l}2 |
- {1: }l3 |
- {1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ {7: }^l1 |
+ S {100:l}2 |
+ {7: }l3 |
+ {7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
@@ -4936,13 +5022,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S', end_row = 2})
screen:expect{grid=[[
- {1: }^l1 |
+ {7: }^l1 |
S l2 |
S l3 |
- {1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ {7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -4955,13 +5041,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 3, -1, {sign_text='S2', end_row = 4})
screen:expect{grid=[[
- {1: }^l1 |
+ {7: }^l1 |
S1l2 |
- {1: }l3 |
+ {7: }l3 |
S2l4 |
S2l5 |
- {1: } |
- {2:~ }|*3
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -4973,13 +5059,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 3, -1, {sign_text='S1'})
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S2', end_row = 3})
screen:expect{grid=[[
- {1: }^l1 |
- S2{1: }l2 |
- S2{1: }l3 |
- S1S2l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ {7: }^l1 |
+ S2{7: }l2 |
+ S2{7: }l3 |
+ S2S1l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -4993,13 +5079,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 2, -1, {sign_text='S2', end_row=3})
screen:expect{grid=[[
- {1: }^l1 |
- S1{1: }l2 |
- S1S2l3 |
- S2{1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ {7: }^l1 |
+ S1{7: }l2 |
+ S2S1l3 |
+ S2{7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -5014,11 +5100,11 @@ l5
screen:expect{grid=[[
S1^l1 |
S2l2 |
- {1: }l3 |
- {1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ {7: }l3 |
+ {7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -5027,8 +5113,8 @@ l5
insert(example_test3)
feed 'gg'
- helpers.command('sign define Oldsign text=x')
- helpers.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
+ n.command('sign define Oldsign text=x')
+ n.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
api.nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='S1'})
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S2'})
@@ -5036,13 +5122,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 2, -1, {sign_text='S5'})
screen:expect{grid=[[
- S1S4^l1 |
- x S2l2 |
- S5{1: }l3 |
- {1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*3
+ S4S1^l1 |
+ S2x l2 |
+ S5{7: }l3 |
+ {7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -5051,8 +5137,8 @@ l5
insert(example_test3)
feed 'gg'
- helpers.command('sign define Oldsign text=x')
- helpers.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
+ n.command('sign define Oldsign text=x')
+ n.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
api.nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='S1'})
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S2'})
@@ -5061,13 +5147,13 @@ l5
api.nvim_buf_set_extmark(0, ns, 2, -1, {sign_text='S5'})
screen:expect{grid=[[
- S1S3S4^l1 |
- x S2S3l2 |
- S3S5{1: }l3 |
- S3{1: }l4 |
- S3{1: }l5 |
- {1: } |
- {2:~ }|*3
+ S4S3S1^l1 |
+ S3S2x l2 |
+ S5S3{7: }l3 |
+ S3{7: }l4 |
+ S3{7: }l5 |
+ {7: } |
+ {1:~ }|*3
|
]]}
end)
@@ -5081,11 +5167,11 @@ l5
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='X', end_row=3})
screen:expect{grid=[[
- X {1: }^l3 |
- X {1: }l4 |
- {1: }l5 |
- {1: } |
- {2:~ }|*5
+ X {7: }^l3 |
+ X {7: }l4 |
+ {7: }l5 |
+ {7: } |
+ {1:~ }|*5
|
]]}
end)
@@ -5110,8 +5196,8 @@ l5
end
screen:expect{grid=[[
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:h} |*8
- W X Y Z {3:a} {3:b} {3:c} {3:d} {3:e} {3:f} {3:g} {3:^h} |
+ Z Y X W {100:a} {100:b} {100:c} {100:d} {100:e} {100:f} {100:g} {100:h} |*8
+ Z Y X W {100:a} {100:b} {100:c} {100:d} {100:e} {100:f} {100:g} {100:^h} |
|
]]}
end)
@@ -5130,8 +5216,8 @@ l5
api.nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='S1', priority=1})
screen:expect{grid=[[
- S1S2O3S4S5^l1 |
- {1: }l2 |
+ S5S4O3S2S1^l1 |
+ {7: }l2 |
|
]]}
@@ -5140,7 +5226,7 @@ l5
screen:expect{grid=[[
S5^l1 |
- {1: }l2 |
+ {7: }l2 |
|
]]}
end)
@@ -5161,7 +5247,7 @@ l5
command([[exe 'sign place 09 line=1 name=Oldsign priority=10 buffer=' . bufnr('')]])
screen:expect{grid=[[
O3O3O3O3O3O3O3O3O3^ |
- {2:~ }|
+ {1:~ }|
|
]]}
@@ -5170,8 +5256,8 @@ l5
api.nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='S5', priority=200})
screen:expect{grid=[[
- O3O3O3O3O3O3O3O3S5^ |
- {2:~ }|
+ S5O3O3O3O3O3O3O3O3^ |
+ {1:~ }|
|
]]}
@@ -5216,34 +5302,34 @@ l5
feed('gg')
local s1 = [[
- S1S2^l1 |
- S2S3l2 |
- S2S3l3 |
+ S2S1^l1 |
+ S3S2l2 |
+ S3S2l3 |
|
]]
screen:expect{grid=s1}
-- Correct width when :move'ing a line with signs
command('move2')
screen:expect{grid=[[
- S3{1: }l2 |
- S1S2S3^l1 |
- {1: }l3 |
+ S3{7: }l2 |
+ S3S2S1^l1 |
+ {7: }l3 |
|
]]}
command('silent undo')
screen:expect{grid=s1}
command('d')
screen:expect{grid=[[
- S1S2S3^l2 |
- S2S3{1: }l3 |
- {1: }l4 |
+ S3S2S1^l2 |
+ S3S2{7: }l3 |
+ {7: }l4 |
|
]]}
command('d')
screen:expect{grid=[[
- S1S2S3^l3 |
- {1: }l4 |
- {1: }l5 |
+ S3S2S1^l3 |
+ {7: }l4 |
+ {7: }l5 |
|
]]}
end)
@@ -5289,9 +5375,9 @@ l5
norm 4Gdd
]])
screen:expect{grid=[[
- {1: }l3 |
- S1S2l5 |
- {1: }^ |
+ {7: }l3 |
+ S2S1l5 |
+ {7: }^ |
|
]]}
end)
@@ -5306,7 +5392,7 @@ l5
screen:expect{grid=[[
S1l |
S2^1 |
- {1: }l2 |
+ {7: }l2 |
|
]]}
end)
@@ -5319,8 +5405,8 @@ l5
api.nvim_buf_set_extmark(buf, ns, 0, 0, { sign_text = 'h' })
screen:expect{grid=[[
h ^l1 |
- {1: }l2 |
- {1: }l3 |
+ {7: }l2 |
+ {7: }l3 |
|
]]}
api.nvim_win_set_buf(0, api.nvim_create_buf(false, true))
@@ -5329,7 +5415,7 @@ l5
api.nvim_win_set_buf(0, buf)
screen:expect{grid=[[
^ |
- {2:~ }|*2
+ {1:~ }|*2
|
]]}
end)
@@ -5370,8 +5456,8 @@ l5
api.nvim_buf_set_extmark(0, ns, 0, 0, {sign_text = 'S1'})
screen:expect{grid=[[
- S1{4:^a} |
- {2:~ }|*2
+ S1{9:^a} |
+ {1:~ }|*2
|
]]}
end)
@@ -5382,8 +5468,8 @@ l5
api.nvim_buf_set_extmark(0, ns2, 0, 0, {sign_text = 'S2', id = 1})
screen:expect{grid=[[
- S1S2^ |
- {2:~ }|*8
+ S2S1^ |
+ {1:~ }|*8
|
]]}
end)
@@ -5403,9 +5489,9 @@ l5
command('0d29')
screen:expect{grid=[[
- S1S2S3S4{4:^foo} |
- S5{1: }{4:foo} |
- {2:~ }|*7
+ S4S3S2S1{9:^foo} |
+ S5{7: }{9:foo} |
+ {1:~ }|*7
29 fewer lines |
]]}
@@ -5420,11 +5506,6 @@ describe('decorations: virt_text', function()
clear()
screen = Screen.new(50, 10)
screen:attach()
- screen:set_default_attr_ids {
- [1] = {foreground = Screen.colors.Brown};
- [2] = {foreground = Screen.colors.Fuchsia};
- [3] = {bold = true, foreground = Screen.colors.Blue1};
- }
end)
it('avoids regression in #17638', function()
@@ -5444,12 +5525,12 @@ describe('decorations: virt_text', function()
})
screen:expect{grid=[[
- {1: 4 } |
- {1: 3 }hello |
- {1: 2 }hello {2:hello} |
- {1: 1 }hello |
- {1:5 }helloVIRTUA^L |
- {3:~ }|*4
+ {8: 4 } |
+ {8: 3 }hello |
+ {8: 2 }hello {26:hello} |
+ {8: 1 }hello |
+ {8:5 }helloVIRTUA^L |
+ {1:~ }|*4
|
]]}
@@ -5457,12 +5538,12 @@ describe('decorations: virt_text', function()
feed('k')
screen:expect{grid=[[
- {1: 3 } |
- {1: 2 }hello |
- {1: 1 }hello {2:hello} |
- {1:4 }hell^o |
- {1: 1 }helloVIRTUAL |
- {3:~ }|*4
+ {8: 3 } |
+ {8: 2 }hello |
+ {8: 1 }hello {26:hello} |
+ {8:4 }hell^o |
+ {8: 1 }helloVIRTUAL |
+ {1:~ }|*4
|
]]}
end)
@@ -5474,7 +5555,7 @@ describe('decorations: virt_text', function()
|
hello |*4
hell^o |
- {3:~ }|*3
+ {1:~ }|*3
|
]]}
@@ -5487,7 +5568,7 @@ describe('decorations: virt_text', function()
|
hello |*4
hell^o world |
- {3:~ }|*3
+ {1:~ }|*3
|
]]}
end)
@@ -5495,13 +5576,14 @@ end)
describe('decorations: window scoped', function()
local screen, ns
+ local url = 'https://example.com'
before_each(function()
clear()
screen = Screen.new(20, 10)
screen:attach()
- screen:set_default_attr_ids {
- [1] = { foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Blue1, bold = true },
+ screen:add_extra_attr_ids {
+ [100] = { special = Screen.colors.Red, undercurl = true },
+ [101] = { url = "https://example.com" },
}
ns = api.nvim_create_namespace 'test'
@@ -5512,7 +5594,7 @@ describe('decorations: window scoped', function()
local noextmarks = {
grid = [[
1234^5 |
- {2:~ }|*8
+ {1:~ }|*8
|
]]}
@@ -5528,12 +5610,12 @@ describe('decorations: window scoped', function()
screen:expect(noextmarks)
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
- {1:123}4^5 |
- {2:~ }|*8
+ {18:123}4^5 |
+ {1:~ }|*8
|
]]}
@@ -5563,12 +5645,12 @@ describe('decorations: window scoped', function()
screen:expect(noextmarks)
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
- 1{1:c}34^5{1:b} {1:a} {1:d}|
- {2:~ }|*8
+ 1{18:c}34^5{18:b} {18:a} {18:d}|
+ {1:~ }|*8
|
]]}
@@ -5585,13 +5667,13 @@ describe('decorations: window scoped', function()
screen:expect(noextmarks)
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
1234^5 |
- {1:a} |
- {2:~ }|*7
+ {18:a} |
+ {1:~ }|*7
|
]]}
@@ -5609,17 +5691,17 @@ describe('decorations: window scoped', function()
screen:expect(noextmarks)
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
- 12{1:bbbbbbbbbbbbbbbbbb}|
+ 12{18:bbbbbbbbbbbbbbbbbb}|
34^5 |
- {2:~ }|*7
+ {1:~ }|*7
|
]]}
- api.nvim_win_remove_ns(0, ns)
+ api.nvim__win_del_ns(0, ns)
screen:expect(noextmarks)
end)
@@ -5634,7 +5716,7 @@ describe('decorations: window scoped', function()
screen:expect(noextmarks)
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
@@ -5650,12 +5732,6 @@ describe('decorations: window scoped', function()
end)
it('statuscolumn hl group', function()
- local attrs = screen:get_default_attr_ids()
- table.insert(attrs, {
- foreground = Screen.colors.Brown,
- })
- screen:set_default_attr_ids(attrs)
-
set_scoped_extmark(0, 0, {
number_hl_group='comment',
})
@@ -5667,17 +5743,17 @@ describe('decorations: window scoped', function()
screen:expect {
grid = [[
- {3: 1 }1234^5 |
- {2:~ }|*8
+ {8: 1 }1234^5 |
+ {1:~ }|*8
|
]]}
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
- {1: 1 1234^5 }|
- {2:~ }|*8
+ {18: 1 1234^5 }|
+ {1:~ }|*8
|
]]}
@@ -5686,18 +5762,13 @@ describe('decorations: window scoped', function()
screen:expect {
grid = [[
- {3: 1 }1234^5 |
- {2:~ }|*8
+ {8: 1 }1234^5 |
+ {1:~ }|*8
|
]]}
end)
it('spell', function()
- local attrs = screen:get_default_attr_ids()
- table.insert(attrs, {
- special = Screen.colors.Red, undercurl = true
- })
- screen:set_default_attr_ids(attrs)
api.nvim_buf_set_lines(0,0,-1,true,{'aa'})
set_scoped_extmark(0, 0, {
@@ -5712,16 +5783,16 @@ describe('decorations: window scoped', function()
screen:expect {
grid = [[
a^a |
- {2:~ }|*8
+ {1:~ }|*8
|
]]}
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
- {3:a^a} |
- {2:~ }|*8
+ {100:a^a} |
+ {1:~ }|*8
|
]]}
@@ -5731,19 +5802,12 @@ describe('decorations: window scoped', function()
screen:expect {
grid = [[
a^a |
- {2:~ }|*8
+ {1:~ }|*8
|
]]}
end)
it('url', function()
- local url = 'https://example.com'
- local attrs = screen:get_default_attr_ids()
- table.insert(attrs, {
- url = url,
- })
- screen:set_default_attr_ids(attrs)
-
set_scoped_extmark(0, 0, {
end_col=3,
url=url,
@@ -5751,12 +5815,12 @@ describe('decorations: window scoped', function()
screen:expect(noextmarks)
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
- {3:123}4^5 |
- {2:~ }|*8
+ {101:123}4^5 |
+ {1:~ }|*8
|
]]}
@@ -5772,12 +5836,12 @@ describe('decorations: window scoped', function()
end_col = 3,
})
- api.nvim_win_add_ns(0, ns)
+ api.nvim__win_add_ns(0, ns)
screen:expect {
grid = [[
- {1:123}4^5 |
- {2:~ }|*8
+ {18:123}4^5 |
+ {1:~ }|*8
|
]]}
@@ -5795,8 +5859,8 @@ describe('decorations: window scoped', function()
screen:expect {
grid = [[
- {1:123}4^5 |
- {2:~ }|*8
+ {18:123}4^5 |
+ {1:~ }|*8
|
]]}
@@ -5816,34 +5880,34 @@ describe('decorations: window scoped', function()
end_col = 3,
})
- eq(true, api.nvim_win_add_ns(0, ns))
- eq({ ns }, api.nvim_win_get_ns(0))
+ eq(true, api.nvim__win_add_ns(0, ns))
+ eq({ ns }, api.nvim__win_get_ns(0))
screen:expect {
grid = [[
- {1:123}4^5 |
- {2:~ }|*8
+ {18:123}4^5 |
+ {1:~ }|*8
|
]]}
command 'split'
command 'only'
- eq({}, api.nvim_win_get_ns(0))
+ eq({}, api.nvim__win_get_ns(0))
screen:expect(noextmarks)
- eq(true, api.nvim_win_add_ns(0, ns))
- eq({ ns }, api.nvim_win_get_ns(0))
+ eq(true, api.nvim__win_add_ns(0, ns))
+ eq({ ns }, api.nvim__win_get_ns(0))
screen:expect {
grid = [[
- {1:123}4^5 |
- {2:~ }|*8
+ {18:123}4^5 |
+ {1:~ }|*8
|
]]}
- eq(true, api.nvim_win_remove_ns(0, ns))
- eq({}, api.nvim_win_get_ns(0))
+ eq(true, api.nvim__win_del_ns(0, ns))
+ eq({}, api.nvim__win_get_ns(0))
screen:expect(noextmarks)
end)
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index e0dfde35f2..e79621f364 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -1,15 +1,16 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local feed = helpers.feed
-local clear = helpers.clear
-local command = helpers.command
-local insert = helpers.insert
-local write_file = helpers.write_file
-local dedent = helpers.dedent
-local exec = helpers.exec
-local eq = helpers.eq
-local api = helpers.api
+local feed = n.feed
+local clear = n.clear
+local command = n.command
+local insert = n.insert
+local write_file = t.write_file
+local dedent = t.dedent
+local exec = n.exec
+local eq = t.eq
+local api = n.api
before_each(clear)
@@ -40,17 +41,6 @@ describe('Diff mode screen', function()
screen = Screen.new(40, 16)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.LightBlue },
- [5] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { bold = true, reverse = true },
- [8] = { bold = true, background = Screen.colors.Red },
- [9] = { background = Screen.colors.LightMagenta },
- })
end)
it('Add a line in beginning of file 2', function()
@@ -60,31 +50,31 @@ describe('Diff mode screen', function()
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1: }{2:------------------}│{1: }{4:0 }|
- {1: }^1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }{23:------------------}│{7: }{22:0 }|
+ {7: }^1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7:+ }{13:+-- 4 lines: 7···}│{7:+ }{13:+-- 4 lines: 7··}|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1: }{2:------------------}│{1: }{4:0 }|
- {1: }^1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }{23:------------------}│{7: }{22:0 }|
+ {7: }^1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7:+ }{13:+-- 4 lines: 7···}│{7:+ }{13:+-- 4 lines: 7··}|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
end)
@@ -96,31 +86,31 @@ describe('Diff mode screen', function()
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1: }{4:^0 }│{1: }{2:-----------------}|
- {1: }1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }{22:^0 }│{7: }{23:-----------------}|
+ {7: }1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7:+ }{13:+-- 4 lines: 7···}│{7:+ }{13:+-- 4 lines: 7··}|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1: }{4:^0 }│{1: }{2:-----------------}|
- {1: }1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1:+ }{5:+-- 4 lines: 7···}│{1:+ }{5:+-- 4 lines: 7··}|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }{22:^0 }│{7: }{23:-----------------}|
+ {7: }1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7:+ }{13:+-- 4 lines: 7···}│{7:+ }{13:+-- 4 lines: 7··}|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
end)
@@ -132,44 +122,44 @@ describe('Diff mode screen', function()
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1:+ }{5:^+-- 4 lines: 1···}│{1:+ }{5:+-- 4 lines: 1··}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 4 lines: 1···}│{7:+ }{13:+-- 4 lines: 1··}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{23:------------------}│{7: }{22:11 }|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1:+ }{5:^+-- 4 lines: 1···}│{1:+ }{5:+-- 4 lines: 1··}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 4 lines: 1···}│{7:+ }{13:+-- 4 lines: 1··}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{23:------------------}│{7: }{22:11 }|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
screen:try_resize(40, 9)
screen:expect([[
- {1:+ }{5:^+-- 4 lines: 1···}│{1:+ }{5:+-- 4 lines: 1··}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 4 lines: 1···}│{7:+ }{13:+-- 4 lines: 1··}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
end)
@@ -181,44 +171,44 @@ describe('Diff mode screen', function()
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1:+ }{5:^+-- 4 lines: 1···}│{1:+ }{5:+-- 4 lines: 1··}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 4 lines: 1···}│{7:+ }{13:+-- 4 lines: 1··}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{22:11 }│{7: }{23:-----------------}|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1:+ }{5:^+-- 4 lines: 1···}│{1:+ }{5:+-- 4 lines: 1··}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 4 lines: 1···}│{7:+ }{13:+-- 4 lines: 1··}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{22:11 }│{7: }{23:-----------------}|
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
screen:try_resize(40, 9)
screen:expect([[
- {1:+ }{5:^+-- 4 lines: 1···}│{1:+ }{5:+-- 4 lines: 1··}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 4 lines: 1···}│{7:+ }{13:+-- 4 lines: 1··}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
end)
@@ -230,39 +220,39 @@ describe('Diff mode screen', function()
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1: }^1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }{2:------------------}│{1: }{4:4 }|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|*2
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }{23:------------------}│{7: }{22:4 }|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{22:11 }│{7: }{23:-----------------}|
+ {1:~ }│{1:~ }|*2
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1: }^1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }{2:------------------}│{1: }{4:4 }|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{4:11 }│{1: }{2:-----------------}|
- {6:~ }│{6:~ }|*2
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }{23:------------------}│{7: }{22:4 }|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{22:11 }│{7: }{23:-----------------}|
+ {1:~ }│{1:~ }|*2
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
end)
@@ -274,39 +264,39 @@ describe('Diff mode screen', function()
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1: }^1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }{4:4 }│{1: }{2:-----------------}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|*2
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }{22:4 }│{7: }{23:-----------------}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{23:------------------}│{7: }{22:11 }|
+ {1:~ }│{1:~ }|*2
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1: }^1 │{1: }1 |
- {1: }2 │{1: }2 |
- {1: }3 │{1: }3 |
- {1: }4 │{1: }4 |
- {1: }{4:4 }│{1: }{2:-----------------}|
- {1: }5 │{1: }5 |
- {1: }6 │{1: }6 |
- {1: }7 │{1: }7 |
- {1: }8 │{1: }8 |
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }{2:------------------}│{1: }{4:11 }|
- {6:~ }│{6:~ }|*2
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^1 │{7: }1 |
+ {7: }2 │{7: }2 |
+ {7: }3 │{7: }3 |
+ {7: }4 │{7: }4 |
+ {7: }{22:4 }│{7: }{23:-----------------}|
+ {7: }5 │{7: }5 |
+ {7: }6 │{7: }6 |
+ {7: }7 │{7: }7 |
+ {7: }8 │{7: }8 |
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{23:------------------}│{7: }{22:11 }|
+ {1:~ }│{1:~ }|*2
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
end)
@@ -372,41 +362,41 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=internal,filler<cr>')
screen:expect([[
- {1: }^#include <stdio.h>│{1: }#include <stdio.h|
- {1: } │{1: } |
- {1: }{8:// Frobs foo heart}│{1: }{8:int fib(int n)}{9: }|
- {1: }{4:int frobnitz(int f}│{1: }{2:-----------------}|
- {1: }{ │{1: }{ |
- {1: }{9: i}{8:nt i;}{9: }│{1: }{9: i}{8:f(n > 2)}{9: }|
- {1: }{4: for(i = 0; i <}│{1: }{2:-----------------}|
- {1: } { │{1: } { |
- {1: }{9: }{8:printf("Yo}│{1: }{9: }{8:return fi}|
- {1: }{4: printf("%d}│{1: }{2:-----------------}|
- {1: } } │{1: } } |
- {1: }{2:------------------}│{1: }{4: return 1; }|
- {1: }} │{1: }} |
- {1: } │{1: } |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^#include <stdio.h>│{7: }#include <stdio.h|
+ {7: } │{7: } |
+ {7: }{27:// Frobs foo heart}│{7: }{27:int fib(int n)}{4: }|
+ {7: }{22:int frobnitz(int f}│{7: }{23:-----------------}|
+ {7: }{ │{7: }{ |
+ {7: }{4: i}{27:nt i;}{4: }│{7: }{4: i}{27:f(n > 2)}{4: }|
+ {7: }{22: for(i = 0; i <}│{7: }{23:-----------------}|
+ {7: } { │{7: } { |
+ {7: }{4: }{27:printf("Yo}│{7: }{4: }{27:return fi}|
+ {7: }{22: printf("%d}│{7: }{23:-----------------}|
+ {7: } } │{7: } } |
+ {7: }{23:------------------}│{7: }{22: return 1; }|
+ {7: }} │{7: }} |
+ {7: } │{7: } |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=internal,filler |
]])
feed('G')
screen:expect([[
- {1: }{2:------------------}│{1: }{4:int frobnitz(int }|
- {1: }{ │{1: }{ |
- {1: }{9: i}{8:f(n > 1)}{9: }│{1: }{9: i}{8:nt i;}{9: }|
- {1: }{2:------------------}│{1: }{4: for(i = 0; i }|
- {1: } { │{1: } { |
- {1: }{9: }{8:return fac}│{1: }{9: }{8:printf("%}|
- {1: } } │{1: } } |
- {1: }{4: return 1; }│{1: }{2:-----------------}|
- {1: }} │{1: }} |
- {1: } │{1: } |
- {1: }int main(int argc,│{1: }int main(int argc|
- {1: }{ │{1: }{ |
- {1: }{9: frobnitz(f}{8:act}{9:(}│{1: }{9: frobnitz(f}{8:ib}{9:(}|
- {1: }^} │{1: }} |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }{23:------------------}│{7: }{22:int frobnitz(int }|
+ {7: }{ │{7: }{ |
+ {7: }{4: i}{27:f(n > 1)}{4: }│{7: }{4: i}{27:nt i;}{4: }|
+ {7: }{23:------------------}│{7: }{22: for(i = 0; i }|
+ {7: } { │{7: } { |
+ {7: }{4: }{27:return fac}│{7: }{4: }{27:printf("%}|
+ {7: } } │{7: } } |
+ {7: }{22: return 1; }│{7: }{23:-----------------}|
+ {7: }} │{7: }} |
+ {7: } │{7: } |
+ {7: }int main(int argc,│{7: }int main(int argc|
+ {7: }{ │{7: }{ |
+ {7: }{4: frobnitz(f}{27:act}{4:(}│{7: }{4: frobnitz(f}{27:ib}{4:(}|
+ {7: }^} │{7: }} |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=internal,filler |
]])
end)
@@ -415,41 +405,41 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=internal,filler,algorithm:patience<cr>')
screen:expect([[
- {1: }^#include <stdio.h>│{1: }#include <stdio.h|
- {1: } │{1: } |
- {1: }{2:------------------}│{1: }{4:int fib(int n) }|
- {1: }{2:------------------}│{1: }{4:{ }|
- {1: }{2:------------------}│{1: }{4: if(n > 2) }|
- {1: }{2:------------------}│{1: }{4: { }|
- {1: }{2:------------------}│{1: }{4: return fi}|
- {1: }{2:------------------}│{1: }{4: } }|
- {1: }{2:------------------}│{1: }{4: return 1; }|
- {1: }{2:------------------}│{1: }{4:} }|
- {1: }{2:------------------}│{1: }{4: }|
- {1: }// Frobs foo heart│{1: }// Frobs foo hear|
- {1: }int frobnitz(int f│{1: }int frobnitz(int |
- {1: }{ │{1: }{ |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^#include <stdio.h>│{7: }#include <stdio.h|
+ {7: } │{7: } |
+ {7: }{23:------------------}│{7: }{22:int fib(int n) }|
+ {7: }{23:------------------}│{7: }{22:{ }|
+ {7: }{23:------------------}│{7: }{22: if(n > 2) }|
+ {7: }{23:------------------}│{7: }{22: { }|
+ {7: }{23:------------------}│{7: }{22: return fi}|
+ {7: }{23:------------------}│{7: }{22: } }|
+ {7: }{23:------------------}│{7: }{22: return 1; }|
+ {7: }{23:------------------}│{7: }{22:} }|
+ {7: }{23:------------------}│{7: }{22: }|
+ {7: }// Frobs foo heart│{7: }// Frobs foo hear|
+ {7: }int frobnitz(int f│{7: }int frobnitz(int |
+ {7: }{ │{7: }{ |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
feed('G')
screen:expect([[
- {1: } │{1: } |
- {1: }{4:int fact(int n) }│{1: }{2:-----------------}|
- {1: }{4:{ }│{1: }{2:-----------------}|
- {1: }{4: if(n > 1) }│{1: }{2:-----------------}|
- {1: }{4: { }│{1: }{2:-----------------}|
- {1: }{4: return fac}│{1: }{2:-----------------}|
- {1: }{4: } }│{1: }{2:-----------------}|
- {1: }{4: return 1; }│{1: }{2:-----------------}|
- {1: }{4:} }│{1: }{2:-----------------}|
- {1: }{4: }│{1: }{2:-----------------}|
- {1: }int main(int argc,│{1: }int main(int argc|
- {1: }{ │{1: }{ |
- {1: }{9: frobnitz(f}{8:act}{9:(}│{1: }{9: frobnitz(f}{8:ib}{9:(}|
- {1: }^} │{1: }} |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: } │{7: } |
+ {7: }{22:int fact(int n) }│{7: }{23:-----------------}|
+ {7: }{22:{ }│{7: }{23:-----------------}|
+ {7: }{22: if(n > 1) }│{7: }{23:-----------------}|
+ {7: }{22: { }│{7: }{23:-----------------}|
+ {7: }{22: return fac}│{7: }{23:-----------------}|
+ {7: }{22: } }│{7: }{23:-----------------}|
+ {7: }{22: return 1; }│{7: }{23:-----------------}|
+ {7: }{22:} }│{7: }{23:-----------------}|
+ {7: }{22: }│{7: }{23:-----------------}|
+ {7: }int main(int argc,│{7: }int main(int argc|
+ {7: }{ │{7: }{ |
+ {7: }{4: frobnitz(f}{27:act}{4:(}│{7: }{4: frobnitz(f}{27:ib}{4:(}|
+ {7: }^} │{7: }} |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
end)
@@ -458,41 +448,41 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=internal,filler,algorithm:histogram<cr>')
screen:expect([[
- {1: }^#include <stdio.h>│{1: }#include <stdio.h|
- {1: } │{1: } |
- {1: }{2:------------------}│{1: }{4:int fib(int n) }|
- {1: }{2:------------------}│{1: }{4:{ }|
- {1: }{2:------------------}│{1: }{4: if(n > 2) }|
- {1: }{2:------------------}│{1: }{4: { }|
- {1: }{2:------------------}│{1: }{4: return fi}|
- {1: }{2:------------------}│{1: }{4: } }|
- {1: }{2:------------------}│{1: }{4: return 1; }|
- {1: }{2:------------------}│{1: }{4:} }|
- {1: }{2:------------------}│{1: }{4: }|
- {1: }// Frobs foo heart│{1: }// Frobs foo hear|
- {1: }int frobnitz(int f│{1: }int frobnitz(int |
- {1: }{ │{1: }{ |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^#include <stdio.h>│{7: }#include <stdio.h|
+ {7: } │{7: } |
+ {7: }{23:------------------}│{7: }{22:int fib(int n) }|
+ {7: }{23:------------------}│{7: }{22:{ }|
+ {7: }{23:------------------}│{7: }{22: if(n > 2) }|
+ {7: }{23:------------------}│{7: }{22: { }|
+ {7: }{23:------------------}│{7: }{22: return fi}|
+ {7: }{23:------------------}│{7: }{22: } }|
+ {7: }{23:------------------}│{7: }{22: return 1; }|
+ {7: }{23:------------------}│{7: }{22:} }|
+ {7: }{23:------------------}│{7: }{22: }|
+ {7: }// Frobs foo heart│{7: }// Frobs foo hear|
+ {7: }int frobnitz(int f│{7: }int frobnitz(int |
+ {7: }{ │{7: }{ |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
feed('G')
screen:expect([[
- {1: } │{1: } |
- {1: }{4:int fact(int n) }│{1: }{2:-----------------}|
- {1: }{4:{ }│{1: }{2:-----------------}|
- {1: }{4: if(n > 1) }│{1: }{2:-----------------}|
- {1: }{4: { }│{1: }{2:-----------------}|
- {1: }{4: return fac}│{1: }{2:-----------------}|
- {1: }{4: } }│{1: }{2:-----------------}|
- {1: }{4: return 1; }│{1: }{2:-----------------}|
- {1: }{4:} }│{1: }{2:-----------------}|
- {1: }{4: }│{1: }{2:-----------------}|
- {1: }int main(int argc,│{1: }int main(int argc|
- {1: }{ │{1: }{ |
- {1: }{9: frobnitz(f}{8:act}{9:(}│{1: }{9: frobnitz(f}{8:ib}{9:(}|
- {1: }^} │{1: }} |
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: } │{7: } |
+ {7: }{22:int fact(int n) }│{7: }{23:-----------------}|
+ {7: }{22:{ }│{7: }{23:-----------------}|
+ {7: }{22: if(n > 1) }│{7: }{23:-----------------}|
+ {7: }{22: { }│{7: }{23:-----------------}|
+ {7: }{22: return fac}│{7: }{23:-----------------}|
+ {7: }{22: } }│{7: }{23:-----------------}|
+ {7: }{22: return 1; }│{7: }{23:-----------------}|
+ {7: }{22:} }│{7: }{23:-----------------}|
+ {7: }{22: }│{7: }{23:-----------------}|
+ {7: }int main(int argc,│{7: }int main(int argc|
+ {7: }{ │{7: }{ |
+ {7: }{4: frobnitz(f}{27:act}{4:(}│{7: }{4: frobnitz(f}{27:ib}{4:(}|
+ {7: }^} │{7: }} |
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
end)
@@ -525,17 +515,17 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=internal,filler<cr>')
screen:expect([[
- {1: }^def finalize(value│{1: }def finalize(valu|
- {1: } │{1: } |
- {1: } values.each do |│{1: } values.each do |
- {1: }{2:------------------}│{1: }{4: v.prepare }|
- {1: }{2:------------------}│{1: }{4: end }|
- {1: }{2:------------------}│{1: }{4: }|
- {1: }{2:------------------}│{1: }{4: values.each do }|
- {1: } v.finalize │{1: } v.finalize |
- {1: } end │{1: } end |
- {6:~ }│{6:~ }|*5
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^def finalize(value│{7: }def finalize(valu|
+ {7: } │{7: } |
+ {7: } values.each do |│{7: } values.each do |
+ {7: }{23:------------------}│{7: }{22: v.prepare }|
+ {7: }{23:------------------}│{7: }{22: end }|
+ {7: }{23:------------------}│{7: }{22: }|
+ {7: }{23:------------------}│{7: }{22: values.each do }|
+ {7: } v.finalize │{7: } v.finalize |
+ {7: } end │{7: } end |
+ {1:~ }│{1:~ }|*5
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=internal,filler |
]])
end)
@@ -544,17 +534,17 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=internal,filler,indent-heuristic<cr>')
screen:expect([[
- {1: }^def finalize(value│{1: }def finalize(valu|
- {1: } │{1: } |
- {1: }{2:------------------}│{1: }{4: values.each do }|
- {1: }{2:------------------}│{1: }{4: v.prepare }|
- {1: }{2:------------------}│{1: }{4: end }|
- {1: }{2:------------------}│{1: }{4: }|
- {1: } values.each do |│{1: } values.each do |
- {1: } v.finalize │{1: } v.finalize |
- {1: } end │{1: } end |
- {6:~ }│{6:~ }|*5
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^def finalize(value│{7: }def finalize(valu|
+ {7: } │{7: } |
+ {7: }{23:------------------}│{7: }{22: values.each do }|
+ {7: }{23:------------------}│{7: }{22: v.prepare }|
+ {7: }{23:------------------}│{7: }{22: end }|
+ {7: }{23:------------------}│{7: }{22: }|
+ {7: } values.each do |│{7: } values.each do |
+ {7: } v.finalize │{7: } v.finalize |
+ {7: } end │{7: } end |
+ {1:~ }│{1:~ }|*5
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
end)
@@ -564,17 +554,17 @@ int main(int argc, char **argv)
feed(':set diffopt=internal,filler,indent-heuristic,algorithm:patience<cr>')
feed(':<cr>')
screen:expect([[
- {1: }^def finalize(value│{1: }def finalize(valu|
- {1: } │{1: } |
- {1: }{2:------------------}│{1: }{4: values.each do }|
- {1: }{2:------------------}│{1: }{4: v.prepare }|
- {1: }{2:------------------}│{1: }{4: end }|
- {1: }{2:------------------}│{1: }{4: }|
- {1: } values.each do |│{1: } values.each do |
- {1: } v.finalize │{1: } v.finalize |
- {1: } end │{1: } end |
- {6:~ }│{6:~ }|*5
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^def finalize(value│{7: }def finalize(valu|
+ {7: } │{7: } |
+ {7: }{23:------------------}│{7: }{22: values.each do }|
+ {7: }{23:------------------}│{7: }{22: v.prepare }|
+ {7: }{23:------------------}│{7: }{22: end }|
+ {7: }{23:------------------}│{7: }{22: }|
+ {7: } values.each do |│{7: } values.each do |
+ {7: } v.finalize │{7: } v.finalize |
+ {7: } end │{7: } end |
+ {1:~ }│{1:~ }|*5
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
: |
]])
end)
@@ -587,17 +577,17 @@ int main(int argc, char **argv)
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1:+ }{5:^+-- 10 lines: 1···}│{1:+ }{5:+-- 10 lines: 1··}|
- {6:~ }│{6:~ }|*13
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 10 lines: 1···}│{7:+ }{13:+-- 10 lines: 1··}|
+ {1:~ }│{1:~ }|*13
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1:+ }{5:^+-- 10 lines: 1···}│{1:+ }{5:+-- 10 lines: 1··}|
- {6:~ }│{6:~ }|*13
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:+ }{13:^+-- 10 lines: 1···}│{7:+ }{13:+-- 10 lines: 1··}|
+ {1:~ }│{1:~ }|*13
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
end)
@@ -609,17 +599,17 @@ int main(int argc, char **argv)
feed(':set diffopt=filler<cr>')
screen:expect([[
- {1:- }^ │{1:- } |
- {6:~ }│{6:~ }|*13
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:- }^ │{7:- } |
+ {1:~ }│{1:~ }|*13
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1:- }^ │{1:- } |
- {6:~ }│{6:~ }|*13
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7:- }^ │{7:- } |
+ {1:~ }│{1:~ }|*13
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
end)
@@ -631,21 +621,21 @@ int main(int argc, char **argv)
feed(':set diffopt=filler,icase<cr>')
screen:expect([[
- {1: }^a │{1: }A |
- {1: }b │{1: }b |
- {1: }{9:cd }│{1: }{9:cD}{8:e}{9: }|
- {6:~ }│{6:~ }|*11
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }A |
+ {7: }b │{7: }b |
+ {7: }{4:cd }│{7: }{4:cD}{27:e}{4: }|
+ {1:~ }│{1:~ }|*11
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler,icase |
]])
feed(':set diffopt+=internal<cr>')
screen:expect([[
- {1: }^a │{1: }A |
- {1: }b │{1: }b |
- {1: }{9:cd }│{1: }{9:cD}{8:e}{9: }|
- {6:~ }│{6:~ }|*11
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }A |
+ {7: }b │{7: }b |
+ {7: }{4:cd }│{7: }{4:cD}{27:e}{4: }|
+ {1:~ }│{1:~ }|*11
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
end)
@@ -664,16 +654,16 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=filler,iwhite<cr>')
screen:expect([[
- {1: }^int main() │{1: }int main() |
- {1: }{ │{1: }{ |
- {1: }{2:------------------}│{1: }{4: if (0) }|
- {1: }{2:------------------}│{1: }{4: { }|
- {1: } printf("Hello, │{1: } printf("Hel|
- {1: } return 0; │{1: } return 0; |
- {1: }{2:------------------}│{1: }{4: } }|
- {1: }} │{1: }} |
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^int main() │{7: }int main() |
+ {7: }{ │{7: }{ |
+ {7: }{23:------------------}│{7: }{22: if (0) }|
+ {7: }{23:------------------}│{7: }{22: { }|
+ {7: } printf("Hello, │{7: } printf("Hel|
+ {7: } return 0; │{7: } return 0; |
+ {7: }{23:------------------}│{7: }{22: } }|
+ {7: }} │{7: }} |
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler,iwhite |
]])
end)
@@ -682,16 +672,16 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=filler,iwhite,internal<cr>')
screen:expect([[
- {1: }^int main() │{1: }int main() |
- {1: }{ │{1: }{ |
- {1: }{2:------------------}│{1: }{4: if (0) }|
- {1: }{2:------------------}│{1: }{4: { }|
- {1: } printf("Hello, │{1: } printf("Hel|
- {1: } return 0; │{1: } return 0; |
- {1: }{2:------------------}│{1: }{4: } }|
- {1: }} │{1: }} |
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^int main() │{7: }int main() |
+ {7: }{ │{7: }{ |
+ {7: }{23:------------------}│{7: }{22: if (0) }|
+ {7: }{23:------------------}│{7: }{22: { }|
+ {7: } printf("Hello, │{7: } printf("Hel|
+ {7: } return 0; │{7: } return 0; |
+ {7: }{23:------------------}│{7: }{22: } }|
+ {7: }} │{7: }} |
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=filler,iwhite,internal |
]])
end)
@@ -708,14 +698,14 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=internal,filler,iblank<cr>')
screen:expect([[
- {1: }^a │{1: }a |
- {1: }{4: }│{1: }{2:-----------------}|*2
- {1: }cd │{1: }cd |
- {1: }ef │{1: } |
- {1: }{8:xxx}{9: }│{1: }ef |
- {6:~ }│{1: }{8:yyy}{9: }|
- {6:~ }│{6:~ }|*7
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }a |
+ {7: }{22: }│{7: }{23:-----------------}|*2
+ {7: }cd │{7: }cd |
+ {7: }ef │{7: } |
+ {7: }{27:xxx}{4: }│{7: }ef |
+ {1:~ }│{7: }{27:yyy}{4: }|
+ {1:~ }│{1:~ }|*7
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=internal,filler,iblank |
]])
end)
@@ -725,14 +715,14 @@ int main(int argc, char **argv)
feed(':set diffopt=internal,filler,iblank,iwhite<cr>')
feed(':<cr>')
screen:expect([[
- {1: }^a │{1: }a |
- {1: } │{1: }cd |
- {1: } │{1: } |
- {1: }cd │{1: }ef |
- {1: }ef │{1: }{8:yyy}{9: }|
- {1: }{8:xxx}{9: }│{6:~ }|
- {6:~ }│{6:~ }|*8
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }a |
+ {7: } │{7: }cd |
+ {7: } │{7: } |
+ {7: }cd │{7: }ef |
+ {7: }ef │{7: }{27:yyy}{4: }|
+ {7: }{27:xxx}{4: }│{1:~ }|
+ {1:~ }│{1:~ }|*8
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
: |
]])
end)
@@ -742,14 +732,14 @@ int main(int argc, char **argv)
feed(':set diffopt=internal,filler,iblank,iwhiteall<cr>')
feed(':<cr>')
screen:expect([[
- {1: }^a │{1: }a |
- {1: } │{1: }cd |
- {1: } │{1: } |
- {1: }cd │{1: }ef |
- {1: }ef │{1: }{8:yyy}{9: }|
- {1: }{8:xxx}{9: }│{6:~ }|
- {6:~ }│{6:~ }|*8
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }a |
+ {7: } │{7: }cd |
+ {7: } │{7: } |
+ {7: }cd │{7: }ef |
+ {7: }ef │{7: }{27:yyy}{4: }|
+ {7: }{27:xxx}{4: }│{1:~ }|
+ {1:~ }│{1:~ }|*8
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
: |
]])
end)
@@ -759,14 +749,14 @@ int main(int argc, char **argv)
feed(':set diffopt=internal,filler,iblank,iwhiteeol<cr>')
feed(':<cr>')
screen:expect([[
- {1: }^a │{1: }a |
- {1: } │{1: }cd |
- {1: } │{1: } |
- {1: }cd │{1: }ef |
- {1: }ef │{1: }{8:yyy}{9: }|
- {1: }{8:xxx}{9: }│{6:~ }|
- {6:~ }│{6:~ }|*8
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }a |
+ {7: } │{7: }cd |
+ {7: } │{7: } |
+ {7: }cd │{7: }ef |
+ {7: }ef │{7: }{27:yyy}{4: }|
+ {7: }{27:xxx}{4: }│{1:~ }|
+ {1:~ }│{1:~ }|*8
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
: |
]])
end)
@@ -784,16 +774,16 @@ int main(int argc, char **argv)
feed(':set diffopt=internal,filler,iwhiteeol<cr>')
feed(':<cr>')
screen:expect([[
- {1: }^a │{1: }a |
- {1: }x │{1: }x |
- {1: }{9:cd }│{1: }{9:c}{8: }{9:d }|
- {1: }{9:ef }│{1: }{8: }{9:ef }|
- {1: }{9:xx }{8: }{9:xx }│{1: }{9:xx xx }|
- {1: }foo │{1: }foo |
- {1: }{2:------------------}│{1: }{4: }|
- {1: }bar │{1: }bar |
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }a |
+ {7: }x │{7: }x |
+ {7: }{4:cd }│{7: }{4:c}{27: }{4:d }|
+ {7: }{4:ef }│{7: }{27: }{4:ef }|
+ {7: }{4:xx }{27: }{4:xx }│{7: }{4:xx xx }|
+ {7: }foo │{7: }foo |
+ {7: }{23:------------------}│{7: }{22: }|
+ {7: }bar │{7: }bar |
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
: |
]])
end)
@@ -803,16 +793,16 @@ int main(int argc, char **argv)
feed(':set diffopt=internal,filler,iwhiteall<cr>')
feed(':<cr>')
screen:expect([[
- {1: }^a │{1: }a |
- {1: }x │{1: }x |
- {1: }cd │{1: }c d |
- {1: }ef │{1: } ef |
- {1: }xx xx │{1: }xx xx |
- {1: }foo │{1: }foo |
- {1: }{2:------------------}│{1: }{4: }|
- {1: }bar │{1: }bar |
- {6:~ }│{6:~ }|*6
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^a │{7: }a |
+ {7: }x │{7: }x |
+ {7: }cd │{7: }c d |
+ {7: }ef │{7: } ef |
+ {7: }xx xx │{7: }xx xx |
+ {7: }foo │{7: }foo |
+ {7: }{23:------------------}│{7: }{22: }|
+ {7: }bar │{7: }bar |
+ {1:~ }│{1:~ }|*6
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
: |
]])
end)
@@ -883,32 +873,32 @@ int main(int argc, char **argv)
feed('<C-W><C-W>jjjj')
screen:expect([[
- {1: }line 1 │{1: }line 1 |
- {1: }line 2 │{1: }line 2 |
- {1: }line 3 │{1: }line 3 |
- {1: }line 4 │{1: }line 4 |
- {1: } │{1: }^ |
- {1: }{2:-----------------}│{1: }{4:Lorem }|
- {1: }{2:-----------------}│{1: }{4:ipsum }|
- {1: }{2:-----------------}│{1: }{4:dolor }|
- {1: }{2:-----------------}│{1: }{4:sit }|
- {1: }{2:-----------------}│{1: }{4:amet, }|
- {3:<nal-diff-screen-1 }{7:<al-diff-screen-1.2 }|
+ {7: }line 1 │{7: }line 1 |
+ {7: }line 2 │{7: }line 2 |
+ {7: }line 3 │{7: }line 3 |
+ {7: }line 4 │{7: }line 4 |
+ {7: } │{7: }^ |
+ {7: }{23:-----------------}│{7: }{22:Lorem }|
+ {7: }{23:-----------------}│{7: }{22:ipsum }|
+ {7: }{23:-----------------}│{7: }{22:dolor }|
+ {7: }{23:-----------------}│{7: }{22:sit }|
+ {7: }{23:-----------------}│{7: }{22:amet, }|
+ {2:<nal-diff-screen-1 }{3:<al-diff-screen-1.2 }|
:e |
]])
feed('j')
screen:expect([[
- {1: }line 1 │{1: }line 1 |
- {1: }line 2 │{1: }line 2 |
- {1: }line 3 │{1: }line 3 |
- {1: }line 4 │{1: }line 4 |
- {1: } │{1: } |
- {1: }{2:-----------------}│{1: }{4:^Lorem }|
- {1: }{2:-----------------}│{1: }{4:ipsum }|
- {1: }{2:-----------------}│{1: }{4:dolor }|
- {1: }{2:-----------------}│{1: }{4:sit }|
- {1: }{2:-----------------}│{1: }{4:amet, }|
- {3:<nal-diff-screen-1 }{7:<al-diff-screen-1.2 }|
+ {7: }line 1 │{7: }line 1 |
+ {7: }line 2 │{7: }line 2 |
+ {7: }line 3 │{7: }line 3 |
+ {7: }line 4 │{7: }line 4 |
+ {7: } │{7: } |
+ {7: }{23:-----------------}│{7: }{22:^Lorem }|
+ {7: }{23:-----------------}│{7: }{22:ipsum }|
+ {7: }{23:-----------------}│{7: }{22:dolor }|
+ {7: }{23:-----------------}│{7: }{22:sit }|
+ {7: }{23:-----------------}│{7: }{22:amet, }|
+ {2:<nal-diff-screen-1 }{3:<al-diff-screen-1.2 }|
:e |
]])
end)
@@ -942,38 +932,38 @@ int main(int argc, char **argv)
reread()
feed(':set diffopt=internal,filler<cr>')
screen:expect([[
- {1: }^if __name__ == "__│{1: }if __name__ == "_|
- {1: } import sys │{1: } import sys |
- {1: }{9: }{8:app = QWidgets}│{1: }{9: }{8:comment these}|
- {1: }{9: }{8:MainWindow = Q}│{1: }{9: }{8:#app = QWidge}|
- {1: }{9: }{8:ui = UI_}{9:MainWi}│{1: }{9: }{8:#MainWindow =}|
- {1: }{2:------------------}│{1: }{4: add a complet}|
- {1: }{2:------------------}│{1: }{4: #ui = UI_Main}|
- {1: }{2:------------------}│{1: }{4: add another n}|
- {1: } ui.setupUI(Mai│{1: } ui.setupUI(Ma|
- {1: } MainWindow.sho│{1: } MainWindow.sh|
- {1: } sys.exit(app.e│{1: } sys.exit(app.|
- {6:~ }│{6:~ }|*3
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^if __name__ == "__│{7: }if __name__ == "_|
+ {7: } import sys │{7: } import sys |
+ {7: }{4: }{27:app = QWidgets}│{7: }{4: }{27:comment these}|
+ {7: }{4: }{27:MainWindow = Q}│{7: }{4: }{27:#app = QWidge}|
+ {7: }{4: }{27:ui = UI_}{4:MainWi}│{7: }{4: }{27:#MainWindow =}|
+ {7: }{23:------------------}│{7: }{22: add a complet}|
+ {7: }{23:------------------}│{7: }{22: #ui = UI_Main}|
+ {7: }{23:------------------}│{7: }{22: add another n}|
+ {7: } ui.setupUI(Mai│{7: } ui.setupUI(Ma|
+ {7: } MainWindow.sho│{7: } MainWindow.sh|
+ {7: } sys.exit(app.e│{7: } sys.exit(app.|
+ {1:~ }│{1:~ }|*3
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt=internal,filler |
]])
feed('G')
feed(':set diffopt+=linematch:20<cr>')
screen:expect([[
- {1: }if __name__ == "__│{1: }if __name__ == "_|
- {1: } import sys │{1: } import sys |
- {1: }{2:------------------}│{1: }{4: comment these}|
- {1: }{9: app = QWidgets}│{1: }{9: }{8:#}{9:app = QWidge}|
- {1: }{9: MainWindow = Q}│{1: }{9: }{8:#}{9:MainWindow =}|
- {1: }{2:------------------}│{1: }{4: add a complet}|
- {1: }{9: ui = UI_MainWi}│{1: }{9: }{8:#}{9:ui = UI_Main}|
- {1: }{2:------------------}│{1: }{4: add another n}|
- {1: } ui.setupUI(Mai│{1: } ui.setupUI(Ma|
- {1: } MainWindow.sho│{1: } MainWindow.sh|
- {1: } ^sys.exit(app.e│{1: } sys.exit(app.|
- {6:~ }│{6:~ }|*3
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }if __name__ == "__│{7: }if __name__ == "_|
+ {7: } import sys │{7: } import sys |
+ {7: }{23:------------------}│{7: }{22: comment these}|
+ {7: }{4: app = QWidgets}│{7: }{4: }{27:#}{4:app = QWidge}|
+ {7: }{4: MainWindow = Q}│{7: }{4: }{27:#}{4:MainWindow =}|
+ {7: }{23:------------------}│{7: }{22: add a complet}|
+ {7: }{4: ui = UI_MainWi}│{7: }{4: }{27:#}{4:ui = UI_Main}|
+ {7: }{23:------------------}│{7: }{22: add another n}|
+ {7: } ui.setupUI(Mai│{7: } ui.setupUI(Ma|
+ {7: } MainWindow.sho│{7: } MainWindow.sh|
+ {7: } ^sys.exit(app.e│{7: } sys.exit(app.|
+ {1:~ }│{1:~ }|*3
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=linematch:20 |
]])
end)
@@ -993,20 +983,20 @@ ccca]]
reread()
feed(':set diffopt=internal,filler,linematch:20<cr>')
screen:expect([[
- {1: }^DDD │{1: }DDD |
- {1: }{2:------------------}│{1: }{4:AAA }|
- {1: }{8:_a}{9:a }│{1: }{8:ccc}{9:a }|
- {6:~ }│{6:~ }|*11
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^DDD │{7: }DDD |
+ {7: }{23:------------------}│{7: }{22:AAA }|
+ {7: }{27:_a}{4:a }│{7: }{27:ccc}{4:a }|
+ {1:~ }│{1:~ }|*11
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]])
feed(':set diffopt+=icase<cr>')
screen:expect([[
- {1: }^DDD │{1: }DDD |
- {1: }{8:_}{9:aa }│{1: }{8:A}{9:AA }|
- {1: }{2:------------------}│{1: }{4:ccca }|
- {6:~ }│{6:~ }|*11
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^DDD │{7: }DDD |
+ {7: }{27:_}{4:aa }│{7: }{27:A}{4:AA }|
+ {7: }{23:------------------}│{7: }{22:ccca }|
+ {1:~ }│{1:~ }|*11
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=icase |
]])
end)
@@ -1027,22 +1017,22 @@ AAAB]]
feed(':set diffopt=internal,filler,linematch:20<cr>')
screen:expect {
grid = [[
- {1: }^BB │{1: }BB |
- {1: }{9: AA}{8:A}{9: }│{1: }{9: AA}{8:B}{9: }|
- {1: }{2:------------------}│{1: }{4:AAAB }|
- {6:~ }│{6:~ }|*11
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^BB │{7: }BB |
+ {7: }{4: AA}{27:A}{4: }│{7: }{4: AA}{27:B}{4: }|
+ {7: }{23:------------------}│{7: }{22:AAAB }|
+ {1:~ }│{1:~ }|*11
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
|
]],
}
feed(':set diffopt+=iwhiteall<cr>')
screen:expect {
grid = [[
- {1: }^BB │{1: }BB |
- {1: }{2:------------------}│{1: }{4: AAB }|
- {1: }{9: AAA }│{1: }{9:AAA}{8:B}{9: }|
- {6:~ }│{6:~ }|*11
- {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ {7: }^BB │{7: }BB |
+ {7: }{23:------------------}│{7: }{22: AAB }|
+ {7: }{4: AAA }│{7: }{4:AAA}{27:B}{4: }|
+ {1:~ }│{1:~ }|*11
+ {3:<onal-diff-screen-1 }{2:<l-diff-screen-1.2 }|
:set diffopt+=iwhiteall |
]],
}
@@ -1057,16 +1047,16 @@ AAAB]]
command('botright new')
screen:expect {
grid = [[
- {1: }aaa │{1: }aaa |
- {1: }bbb │{1: }bbb |
- {1: }ccc │{1: }ccc |
- {1: } │{1: } |
- {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
- {6:~ }│{6:~ }|
- {3:<onal-diff-screen-1 <l-diff-screen-1.2 }|
+ {7: }aaa │{7: }aaa |
+ {7: }bbb │{7: }bbb |
+ {7: }ccc │{7: }ccc |
+ {7: } │{7: } |
+ {7: }{27:xx}{4: }│{7: }{27:yy}{4: }|
+ {1:~ }│{1:~ }|
+ {2:<onal-diff-screen-1 <l-diff-screen-1.2 }|
^ |
- {6:~ }|*6
- {7:[No Name] }|
+ {1:~ }|*6
+ {3:[No Name] }|
:e |
]],
}
@@ -1074,16 +1064,16 @@ AAAB]]
api.nvim_buf_set_lines(buf, 1, 2, true, { 'BBB' })
screen:expect {
grid = [[
- {1: }aaa │{1: }aaa |
- {1: }{8:BBB}{9: }│{1: }{8:bbb}{9: }|
- {1: }ccc │{1: }ccc |
- {1: } │{1: } |
- {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
- {6:~ }│{6:~ }|
- {3:<-diff-screen-1 [+] <l-diff-screen-1.2 }|
+ {7: }aaa │{7: }aaa |
+ {7: }{27:BBB}{4: }│{7: }{27:bbb}{4: }|
+ {7: }ccc │{7: }ccc |
+ {7: } │{7: } |
+ {7: }{27:xx}{4: }│{7: }{27:yy}{4: }|
+ {1:~ }│{1:~ }|
+ {2:<-diff-screen-1 [+] <l-diff-screen-1.2 }|
^ |
- {6:~ }|*6
- {7:[No Name] }|
+ {1:~ }|*6
+ {3:[No Name] }|
:e |
]],
}
@@ -1097,20 +1087,20 @@ AAAB]]
command('botright split | diffoff')
screen:expect {
grid = [[
- {1: }aaa │{1: }aaa |
- {1: }bbb │{1: }bbb |
- {1: }ccc │{1: }ccc |
- {1: } │{1: } |
- {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
- {6:~ }│{6:~ }|
- {3:<onal-diff-screen-1 <l-diff-screen-1.2 }|
+ {7: }aaa │{7: }aaa |
+ {7: }bbb │{7: }bbb |
+ {7: }ccc │{7: }ccc |
+ {7: } │{7: } |
+ {7: }{27:xx}{4: }│{7: }{27:yy}{4: }|
+ {1:~ }│{1:~ }|
+ {2:<onal-diff-screen-1 <l-diff-screen-1.2 }|
^aaa |
bbb |
ccc |
|
xx |
- {6:~ }|*2
- {7:Xtest-functional-diff-screen-1 }|
+ {1:~ }|*2
+ {3:Xtest-functional-diff-screen-1 }|
:e |
]],
}
@@ -1118,20 +1108,20 @@ AAAB]]
api.nvim_buf_set_lines(buf, 1, 2, true, { 'BBB' })
screen:expect {
grid = [[
- {1: }aaa │{1: }aaa |
- {1: }{8:BBB}{9: }│{1: }{8:bbb}{9: }|
- {1: }ccc │{1: }ccc |
- {1: } │{1: } |
- {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
- {6:~ }│{6:~ }|
- {3:<-diff-screen-1 [+] <l-diff-screen-1.2 }|
+ {7: }aaa │{7: }aaa |
+ {7: }{27:BBB}{4: }│{7: }{27:bbb}{4: }|
+ {7: }ccc │{7: }ccc |
+ {7: } │{7: } |
+ {7: }{27:xx}{4: }│{7: }{27:yy}{4: }|
+ {1:~ }│{1:~ }|
+ {2:<-diff-screen-1 [+] <l-diff-screen-1.2 }|
^aaa |
BBB |
ccc |
|
xx |
- {6:~ }|*2
- {7:Xtest-functional-diff-screen-1 [+] }|
+ {1:~ }|*2
+ {3:Xtest-functional-diff-screen-1 [+] }|
:e |
]],
}
@@ -1220,19 +1210,6 @@ end)
it('diff updates line numbers below filler lines', function()
local screen = Screen.new(40, 14)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.LightBlue },
- [5] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { bold = true, reverse = true },
- [8] = { bold = true, background = Screen.colors.Red },
- [9] = { background = Screen.colors.LightMagenta },
- [10] = { bold = true, foreground = Screen.colors.Brown },
- [11] = { foreground = Screen.colors.Brown },
- })
exec([[
call setline(1, ['a', 'a', 'a', 'y', 'b', 'b', 'b', 'b', 'b'])
vnew
@@ -1241,50 +1218,50 @@ it('diff updates line numbers below filler lines', function()
setlocal number rnu cursorline cursorlineopt=number foldcolumn=0
]])
screen:expect([[
- {1: }a │{10:1 }^a |
- {1: }a │{11: 1 }a |
- {1: }a │{11: 2 }a |
- {1: }{8:x}{9: }│{11: 3 }{8:y}{9: }|
- {1: }{4:x }│{11: }{2:----------------}|*2
- {1: }b │{11: 4 }b |
- {1: }b │{11: 5 }b |
- {1: }b │{11: 6 }b |
- {1: }b │{11: 7 }b |
- {1: }b │{11: 8 }b |
- {6:~ }│{6:~ }|
- {3:[No Name] [+] }{7:[No Name] [+] }|
+ {7: }a │{15:1 }^a |
+ {7: }a │{8: 1 }a |
+ {7: }a │{8: 2 }a |
+ {7: }{27:x}{4: }│{8: 3 }{27:y}{4: }|
+ {7: }{22:x }│{8: }{23:----------------}|*2
+ {7: }b │{8: 4 }b |
+ {7: }b │{8: 5 }b |
+ {7: }b │{8: 6 }b |
+ {7: }b │{8: 7 }b |
+ {7: }b │{8: 8 }b |
+ {1:~ }│{1:~ }|
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]])
feed('j')
screen:expect([[
- {1: }a │{11: 1 }a |
- {1: }a │{10:2 }^a |
- {1: }a │{11: 1 }a |
- {1: }{8:x}{9: }│{11: 2 }{8:y}{9: }|
- {1: }{4:x }│{11: }{2:----------------}|*2
- {1: }b │{11: 3 }b |
- {1: }b │{11: 4 }b |
- {1: }b │{11: 5 }b |
- {1: }b │{11: 6 }b |
- {1: }b │{11: 7 }b |
- {6:~ }│{6:~ }|
- {3:[No Name] [+] }{7:[No Name] [+] }|
+ {7: }a │{8: 1 }a |
+ {7: }a │{15:2 }^a |
+ {7: }a │{8: 1 }a |
+ {7: }{27:x}{4: }│{8: 2 }{27:y}{4: }|
+ {7: }{22:x }│{8: }{23:----------------}|*2
+ {7: }b │{8: 3 }b |
+ {7: }b │{8: 4 }b |
+ {7: }b │{8: 5 }b |
+ {7: }b │{8: 6 }b |
+ {7: }b │{8: 7 }b |
+ {1:~ }│{1:~ }|
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]])
feed('j')
screen:expect([[
- {1: }a │{11: 2 }a |
- {1: }a │{11: 1 }a |
- {1: }a │{10:3 }^a |
- {1: }{8:x}{9: }│{11: 1 }{8:y}{9: }|
- {1: }{4:x }│{11: }{2:----------------}|*2
- {1: }b │{11: 2 }b |
- {1: }b │{11: 3 }b |
- {1: }b │{11: 4 }b |
- {1: }b │{11: 5 }b |
- {1: }b │{11: 6 }b |
- {6:~ }│{6:~ }|
- {3:[No Name] [+] }{7:[No Name] [+] }|
+ {7: }a │{8: 2 }a |
+ {7: }a │{8: 1 }a |
+ {7: }a │{15:3 }^a |
+ {7: }{27:x}{4: }│{8: 1 }{27:y}{4: }|
+ {7: }{22:x }│{8: }{23:----------------}|*2
+ {7: }b │{8: 2 }b |
+ {7: }b │{8: 3 }b |
+ {7: }b │{8: 4 }b |
+ {7: }b │{8: 5 }b |
+ {7: }b │{8: 6 }b |
+ {1:~ }│{1:~ }|
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]])
end)
@@ -1293,16 +1270,6 @@ end)
it('Align the filler lines when changing text in diff mode', function()
local screen = Screen.new(40, 20)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray },
- [2] = { background = Screen.colors.LightCyan, foreground = Screen.colors.Blue1, bold = true },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.LightBlue },
- [5] = { background = Screen.colors.LightMagenta },
- [6] = { background = Screen.colors.Red, bold = true },
- [7] = { foreground = Screen.colors.Blue1, bold = true },
- [8] = { reverse = true, bold = true },
- })
exec([[
call setline(1, range(1, 15))
vnew
@@ -1313,54 +1280,54 @@ it('Align the filler lines when changing text in diff mode', function()
]])
screen:expect {
grid = [[
- {1: }{2:------------------}│{1: }{4:6 }|
- {1: }{2:------------------}│{1: }{4:7 }|
- {1: }{2:------------------}│{1: }{4:8 }|
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }11 │{1: }11 |
- {1: }12 │{1: }12 |
- {1: }13 │{1: }13 |
- {1: }14 │{1: }14 |
- {1:- }1^5 │{1:- }15 |
- {7:~ }│{7:~ }|*8
- {8:[No Name] [+] }{3:[No Name] [+] }|
+ {7: }{23:------------------}│{7: }{22:6 }|
+ {7: }{23:------------------}│{7: }{22:7 }|
+ {7: }{23:------------------}│{7: }{22:8 }|
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }11 │{7: }11 |
+ {7: }12 │{7: }12 |
+ {7: }13 │{7: }13 |
+ {7: }14 │{7: }14 |
+ {7:- }1^5 │{7:- }15 |
+ {1:~ }│{1:~ }|*8
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]],
}
feed('ax<Esc>')
screen:expect {
grid = [[
- {1: }{2:------------------}│{1: }{4:6 }|
- {1: }{2:------------------}│{1: }{4:7 }|
- {1: }{2:------------------}│{1: }{4:8 }|
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }11 │{1: }11 |
- {1: }12 │{1: }12 |
- {1: }13 │{1: }13 |
- {1: }14 │{1: }14 |
- {1: }{5:15}{6:^x}{5: }│{1: }{5:15 }|
- {7:~ }│{7:~ }|*8
- {8:[No Name] [+] }{3:[No Name] [+] }|
+ {7: }{23:------------------}│{7: }{22:6 }|
+ {7: }{23:------------------}│{7: }{22:7 }|
+ {7: }{23:------------------}│{7: }{22:8 }|
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }11 │{7: }11 |
+ {7: }12 │{7: }12 |
+ {7: }13 │{7: }13 |
+ {7: }14 │{7: }14 |
+ {7: }{4:15}{27:^x}{4: }│{7: }{4:15 }|
+ {1:~ }│{1:~ }|*8
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]],
}
feed('<C-W>lay<Esc>')
screen:expect {
grid = [[
- {1: }{2:-----------------}│{1: }{4:6 }|
- {1: }{2:-----------------}│{1: }{4:7 }|
- {1: }{2:-----------------}│{1: }{4:8 }|
- {1: }9 │{1: }9 |
- {1: }10 │{1: }10 |
- {1: }11 │{1: }11 |
- {1: }12 │{1: }12 |
- {1: }13 │{1: }13 |
- {1: }14 │{1: }14 |
- {1: }{5:15}{6:x}{5: }│{1: }{5:15}{6:^y}{5: }|
- {7:~ }│{7:~ }|*8
- {3:[No Name] [+] }{8:[No Name] [+] }|
+ {7: }{23:-----------------}│{7: }{22:6 }|
+ {7: }{23:-----------------}│{7: }{22:7 }|
+ {7: }{23:-----------------}│{7: }{22:8 }|
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }11 │{7: }11 |
+ {7: }12 │{7: }12 |
+ {7: }13 │{7: }13 |
+ {7: }14 │{7: }14 |
+ {7: }{4:15}{27:x}{4: }│{7: }{4:15}{27:^y}{4: }|
+ {1:~ }│{1:~ }|*8
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]],
}
@@ -1368,15 +1335,12 @@ end)
it("diff mode doesn't restore invalid 'foldcolumn' value #21647", function()
local screen = Screen.new(60, 6)
- screen:set_default_attr_ids({
- [0] = { foreground = Screen.colors.Blue, bold = true },
- })
screen:attach()
eq('0', api.nvim_get_option_value('foldcolumn', {}))
command('diffsplit | bd')
screen:expect([[
^ |
- {0:~ }|*4
+ {1:~ }|*4
|
]])
eq('0', api.nvim_get_option_value('foldcolumn', {}))
@@ -1385,16 +1349,9 @@ end)
-- oldtest: Test_diff_binary()
it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', function()
local screen = Screen.new(40, 20)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray },
- [2] = { reverse = true },
- [3] = { background = Screen.colors.LightBlue },
- [4] = { background = Screen.colors.LightMagenta },
- [5] = { background = Screen.colors.Red, bold = true },
- [6] = { foreground = Screen.colors.Blue, bold = true },
- [7] = { background = Screen.colors.Red, foreground = Screen.colors.Blue, bold = true },
- [8] = { reverse = true, bold = true },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Blue, bold = true, background = Screen.colors.Red },
+ }
screen:attach()
exec([[
call setline(1, ['a', 'b', "c\n", 'd', 'e', 'f', 'g'])
@@ -1408,15 +1365,15 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
-- Test using internal diff
screen:expect([[
- {1: }{5:^A}{4: }│{1: }{5:a}{4: }|
- {1: }b │{1: }b |
- {1: }{4:c }│{1: }{4:c}{7:^@}{4: }|
- {1: }d │{1: }d |
- {1: }{5:E}{4: }│{1: }{5:e}{4: }|
- {1: }f │{1: }f |
- {1: }g │{1: }g |
- {6:~ }│{6:~ }|*11
- {8:[No Name] [+] }{2:[No Name] [+] }|
+ {7: }{27:^A}{4: }│{7: }{27:a}{4: }|
+ {7: }b │{7: }b |
+ {7: }{4:c }│{7: }{4:c}{100:^@}{4: }|
+ {7: }d │{7: }d |
+ {7: }{27:E}{4: }│{7: }{27:e}{4: }|
+ {7: }f │{7: }f |
+ {7: }g │{7: }g |
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
@@ -1424,15 +1381,15 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
command('set diffopt+=icase')
feed('<C-L>')
screen:expect([[
- {1: }^A │{1: }a |
- {1: }b │{1: }b |
- {1: }{4:c }│{1: }{4:c}{7:^@}{4: }|
- {1: }d │{1: }d |
- {1: }E │{1: }e |
- {1: }f │{1: }f |
- {1: }g │{1: }g |
- {6:~ }│{6:~ }|*11
- {8:[No Name] [+] }{2:[No Name] [+] }|
+ {7: }^A │{7: }a |
+ {7: }b │{7: }b |
+ {7: }{4:c }│{7: }{4:c}{100:^@}{4: }|
+ {7: }d │{7: }d |
+ {7: }E │{7: }e |
+ {7: }f │{7: }f |
+ {7: }g │{7: }g |
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
@@ -1440,15 +1397,15 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
command('set diffopt=filler')
feed('<C-L>')
screen:expect([[
- {1: }{5:^A}{4: }│{1: }{5:a}{4: }|
- {1: }b │{1: }b |
- {1: }{4:c }│{1: }{4:c}{7:^@}{4: }|
- {1: }d │{1: }d |
- {1: }{5:E}{4: }│{1: }{5:e}{4: }|
- {1: }f │{1: }f |
- {1: }g │{1: }g |
- {6:~ }│{6:~ }|*11
- {8:[No Name] [+] }{2:[No Name] [+] }|
+ {7: }{27:^A}{4: }│{7: }{27:a}{4: }|
+ {7: }b │{7: }b |
+ {7: }{4:c }│{7: }{4:c}{100:^@}{4: }|
+ {7: }d │{7: }d |
+ {7: }{27:E}{4: }│{7: }{27:e}{4: }|
+ {7: }f │{7: }f |
+ {7: }g │{7: }g |
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
@@ -1456,15 +1413,15 @@ it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', fun
command('set diffopt+=filler,icase')
feed('<C-L>')
screen:expect([[
- {1: }^A │{1: }a |
- {1: }b │{1: }b |
- {1: }{4:c }│{1: }{4:c}{7:^@}{4: }|
- {1: }d │{1: }d |
- {1: }E │{1: }e |
- {1: }f │{1: }f |
- {1: }g │{1: }g |
- {6:~ }│{6:~ }|*11
- {8:[No Name] [+] }{2:[No Name] [+] }|
+ {7: }^A │{7: }a |
+ {7: }b │{7: }b |
+ {7: }{4:c }│{7: }{4:c}{100:^@}{4: }|
+ {7: }d │{7: }d |
+ {7: }E │{7: }e |
+ {7: }f │{7: }f |
+ {7: }g │{7: }g |
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
end)
@@ -1473,12 +1430,6 @@ end)
it("diff mode draws 'breakindent' correctly after filler lines", function()
local screen = Screen.new(45, 8)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue },
- [2] = { background = Screen.colors.LightBlue },
- [3] = { background = Screen.colors.LightCyan, bold = true, foreground = Screen.colors.Blue },
- [4] = { foreground = Screen.colors.Blue, bold = true },
- })
exec([[
set laststatus=0 diffopt+=followwrap breakindent breakindentopt=min:0
call setline(1, ['a', ' ' .. repeat('c', 50)])
@@ -1488,11 +1439,11 @@ it("diff mode draws 'breakindent' correctly after filler lines", function()
norm! G$
]])
screen:expect([[
- {1: }a │{1: }a |
- {1: }{2:b }│{1: }{3:--------------------}|
- {1: } cccccccccccccccccc│{1: } cccccccccccccccccc|*2
- {1: } cccccccccccccc │{1: } ccccccccccccc^c |
- {4:~ }│{4:~ }|*2
+ {7: }a │{7: }a |
+ {7: }{22:b }│{7: }{23:--------------------}|
+ {7: } cccccccccccccccccc│{7: } cccccccccccccccccc|*2
+ {7: } cccccccccccccc │{7: } ccccccccccccc^c |
+ {1:~ }│{1:~ }|*2
|
]])
end)
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index 0445476780..e1abd43e20 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -1,18 +1,23 @@
-local uv = vim.uv
-
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
+local uv = vim.uv
-local api = helpers.api
-local feed = helpers.feed
-local eq = helpers.eq
-local neq = helpers.neq
-local clear = helpers.clear
-local ok = helpers.ok
-local fn = helpers.fn
-local nvim_prog = helpers.nvim_prog
-local retry = helpers.retry
-local write_file = helpers.write_file
+local api = n.api
+local feed = n.feed
+local eq = t.eq
+local neq = t.neq
+local clear = n.clear
+local ok = t.ok
+local fn = n.fn
+local nvim_prog = n.nvim_prog
+local retry = t.retry
+local write_file = t.write_file
+local assert_log = t.assert_log
+local check_close = n.check_close
+local is_os = t.is_os
+
+local testlog = 'Xtest-embed-log'
local function test_embed(ext_linegrid)
local screen
@@ -53,7 +58,7 @@ local function test_embed(ext_linegrid)
end)
it("doesn't erase output when setting color scheme", function()
- if helpers.is_os('openbsd') then
+ if t.is_os('openbsd') then
pending('FIXME #10804')
end
startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"')
@@ -93,13 +98,18 @@ describe('--embed UI on startup (ext_linegrid=false)', function()
end)
describe('--embed UI', function()
+ after_each(function()
+ check_close()
+ os.remove(testlog)
+ end)
+
it('can pass stdin', function()
local pipe = assert(uv.pipe())
local writer = assert(uv.new_pipe(false))
writer:open(pipe.write)
- clear { args_rm = { '--headless' }, io_extra = pipe.read }
+ clear { args_rm = { '--headless' }, io_extra = pipe.read, env = { NVIM_LOG_FILE = testlog } }
-- attach immediately after startup, for early UI
local screen = Screen.new(40, 8)
@@ -131,6 +141,10 @@ describe('--embed UI', function()
{1:~ }|*4
{2:-- INSERT --} |
]]
+
+ if not is_os('win') then
+ assert_log('Failed to get flags on descriptor 3: Bad file descriptor', testlog, 100)
+ end
end)
it('can pass stdin to -q - #17523', function()
@@ -219,7 +233,7 @@ describe('--embed UI', function()
}
eq({ [16777215] = true }, seen)
- -- NB: by accident how functional/helpers.lua currently handles the default color scheme, the
+ -- NB: by accident how functional/testutil.lua currently handles the default color scheme, the
-- above is sufficient to test the behavior. But in case that workaround is removed, we need
-- a test with an explicit override like below, so do it to remain safe.
startup('--cmd', 'hi NORMAL guibg=#FF00FF')
@@ -239,44 +253,44 @@ describe('--embed UI', function()
screen:expect {
condition = function()
- eq(helpers.paths.test_source_path, screen.pwd)
+ eq(t.paths.test_source_path, screen.pwd)
end,
}
-- Change global cwd
- helpers.command(string.format('cd %s/src/nvim', helpers.paths.test_source_path))
+ n.command(string.format('cd %s/src/nvim', t.paths.test_source_path))
screen:expect {
condition = function()
- eq(string.format('%s/src/nvim', helpers.paths.test_source_path), screen.pwd)
+ eq(string.format('%s/src/nvim', t.paths.test_source_path), screen.pwd)
end,
}
-- Split the window and change the cwd in the split
- helpers.command('new')
- helpers.command(string.format('lcd %s/test', helpers.paths.test_source_path))
+ n.command('new')
+ n.command(string.format('lcd %s/test', t.paths.test_source_path))
screen:expect {
condition = function()
- eq(string.format('%s/test', helpers.paths.test_source_path), screen.pwd)
+ eq(string.format('%s/test', t.paths.test_source_path), screen.pwd)
end,
}
-- Move to the original window
- helpers.command('wincmd p')
+ n.command('wincmd p')
screen:expect {
condition = function()
- eq(string.format('%s/src/nvim', helpers.paths.test_source_path), screen.pwd)
+ eq(string.format('%s/src/nvim', t.paths.test_source_path), screen.pwd)
end,
}
-- Change global cwd again
- helpers.command(string.format('cd %s', helpers.paths.test_source_path))
+ n.command(string.format('cd %s', t.paths.test_source_path))
screen:expect {
condition = function()
- eq(helpers.paths.test_source_path, screen.pwd)
+ eq(t.paths.test_source_path, screen.pwd)
end,
}
end)
@@ -284,9 +298,9 @@ end)
describe('--embed --listen UI', function()
it('waits for connection on listening address', function()
- helpers.skip(helpers.is_os('win'))
+ t.skip(t.is_os('win'))
clear()
- local child_server = assert(helpers.new_pipename())
+ local child_server = assert(n.new_pipename())
fn.jobstart({
nvim_prog,
'--embed',
@@ -300,7 +314,7 @@ describe('--embed --listen UI', function()
neq(nil, uv.fs_stat(child_server))
end)
- local child_session = helpers.connect(child_server)
+ local child_session = n.connect(child_server)
local info_ok, api_info = child_session:request('nvim_get_api_info')
ok(info_ok)
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index cdb3b79963..248220e28b 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -1,24 +1,26 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
local os = require('os')
-local clear, feed = helpers.clear, helpers.feed
-local assert_alive = helpers.assert_alive
-local command, feed_command = helpers.command, helpers.feed_command
-local eval = helpers.eval
-local eq = helpers.eq
-local neq = helpers.neq
-local expect = helpers.expect
-local exec = helpers.exec
-local exec_lua = helpers.exec_lua
-local insert = helpers.insert
-local api = helpers.api
-local fn = helpers.fn
-local run = helpers.run
-local pcall_err = helpers.pcall_err
+
+local clear, feed = n.clear, n.feed
+local assert_alive = n.assert_alive
+local command, feed_command = n.command, n.feed_command
+local eval = n.eval
+local eq = t.eq
+local neq = t.neq
+local expect = n.expect
+local exec = n.exec
+local exec_lua = n.exec_lua
+local insert = n.insert
+local api = n.api
+local fn = n.fn
+local run = n.run
+local pcall_err = t.pcall_err
local tbl_contains = vim.tbl_contains
-local curbuf = helpers.api.nvim_get_current_buf
-local curwin = helpers.api.nvim_get_current_win
-local curtab = helpers.api.nvim_get_current_tabpage
+local curbuf = n.api.nvim_get_current_buf
+local curwin = n.api.nvim_get_current_win
+local curtab = n.api.nvim_get_current_tabpage
local NIL = vim.NIL
describe('float window', function()
@@ -325,6 +327,27 @@ describe('float window', function()
eq(12, pos[2])
end)
+ it('error message when reconfig missing relative field', function()
+ local bufnr = api.nvim_create_buf(false, true)
+ local opts = {
+ width = 10,
+ height = 10,
+ col = 5,
+ row = 5,
+ relative = 'editor',
+ style = 'minimal',
+ }
+ local win_id = api.nvim_open_win(bufnr, true, opts)
+ eq(
+ "Missing 'relative' field when reconfiguring floating window 1001",
+ pcall_err(api.nvim_win_set_config, win_id, {
+ width = 3,
+ height = 3,
+ row = 10,
+ col = 10,
+ }))
+ end)
+
it('is not operated on by windo when non-focusable #15374', function()
command([[
let winids = []
@@ -413,6 +436,25 @@ describe('float window', function()
eq(winid, eval('win_getid()'))
end)
+ it('is not active after closing window when non-focusable #28454', function()
+ command('copen')
+ local winid = exec_lua([[
+ local bufnr = vim.api.nvim_create_buf(false, true)
+ local opts = {
+ relative = 'editor',
+ focusable = false,
+ height = 5,
+ width = 5,
+ col = 5,
+ row = 5,
+ }
+ return vim.api.nvim_open_win(bufnr, false, opts)
+ ]])
+ command('wincmd t')
+ command('wincmd q')
+ neq(winid, curwin())
+ end)
+
it('supports windo with focusable and non-focusable floats', function()
local winids = exec_lua([[
local result = {vim.api.nvim_get_current_win()}
@@ -490,7 +532,10 @@ describe('float window', function()
local closed_win = api.nvim_get_current_win()
command('close')
local buf = api.nvim_create_buf(false,false)
- api.nvim_open_win(buf, true, {relative='win', win=closed_win, width=1, height=1, bufpos={0,0}})
+ eq(
+ 'Invalid window id: ' .. closed_win,
+ pcall_err(api.nvim_open_win, buf, true, {relative='win', win=closed_win, width=1, height=1, bufpos={0,0}})
+ )
assert_alive()
end)
@@ -550,6 +595,43 @@ describe('float window', function()
eq({ w0 }, api.nvim_list_wins())
end)
+ it('win_splitmove() can move float into a split', function()
+ command('split')
+ eq({'col', {{'leaf', 1001}, {'leaf', 1000}}}, fn.winlayout())
+
+ local win1 = api.nvim_open_win(0, true, {relative = 'editor', row = 1, col = 1, width = 5, height = 5})
+ fn.win_splitmove(win1, 1001, {vertical = true})
+ eq({'col', {{'row', {{'leaf', win1}, {'leaf', 1001}}}, {'leaf', 1000}}}, fn.winlayout())
+ eq('', api.nvim_win_get_config(win1).relative)
+
+ -- Should be unable to create a split relative to a float, though.
+ local win2 = api.nvim_open_win(0, true, {relative = 'editor', row = 1, col = 1, width = 5, height = 5})
+ eq('Vim:E957: Invalid window number', pcall_err(fn.win_splitmove, win1, win2, {vertical = true}))
+ end)
+
+ it('tp_curwin updated if external window is moved into split', function()
+ local screen = Screen.new(20, 7)
+ screen:attach { ext_multigrid = true }
+
+ command('tabnew')
+ local external_win = api.nvim_open_win(0, true, {external = true, width = 5, height = 5})
+ eq(external_win, api.nvim_get_current_win())
+ eq(2, fn.tabpagenr())
+ command('tabfirst')
+ api.nvim_set_current_win(external_win)
+ eq(external_win, api.nvim_get_current_win())
+ eq(1, fn.tabpagenr())
+
+ command('wincmd J')
+ eq(external_win, api.nvim_get_current_win())
+ eq(false, api.nvim_win_get_config(external_win).external)
+ command('tabnext')
+ eq(2, fn.tabpagenr())
+ neq(external_win, api.nvim_get_current_win())
+
+ screen:detach()
+ end)
+
describe('with only one tabpage,', function()
local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1}
local old_buf, old_win
@@ -836,6 +918,57 @@ describe('float window', function()
end)
end)
+ describe(':close on non-float with floating windows', function()
+ -- XXX: it isn't really clear whether this should quit Nvim, as if the autocommand
+ -- here is BufUnload then it does quit Nvim.
+ -- But with BufWinLeave, this doesn't quit Nvim if there are no floating windows,
+ -- so it shouldn't quit Nvim if there are floating windows.
+ it('does not quit Nvim if BufWinLeave makes it the only non-float', function()
+ exec([[
+ let g:buf = bufnr()
+ new
+ let s:midwin = win_getid()
+ new
+ setlocal bufhidden=wipe
+ call nvim_win_set_config(s:midwin,
+ \ #{relative: 'editor', row: 5, col: 5, width: 5, height: 5})
+ autocmd BufWinLeave * ++once exe g:buf .. 'bwipe!'
+ ]])
+ eq('Vim(close):E855: Autocommands caused command to abort', pcall_err(command, 'close'))
+ assert_alive()
+ end)
+
+ pending('does not crash if BufUnload makes it the only non-float in tabpage', function()
+ exec([[
+ tabnew
+ let g:buf = bufnr()
+ new
+ let s:midwin = win_getid()
+ new
+ setlocal bufhidden=wipe
+ call nvim_win_set_config(s:midwin,
+ \ #{relative: 'editor', row: 5, col: 5, width: 5, height: 5})
+ autocmd BufUnload * ++once exe g:buf .. 'bwipe!'
+ ]])
+ command('close')
+ assert_alive()
+ end)
+
+ it('does not crash if WinClosed from floating window closes it', function()
+ exec([[
+ tabnew
+ new
+ let s:win = win_getid()
+ call nvim_win_set_config(s:win,
+ \ #{relative: 'editor', row: 5, col: 5, width: 5, height: 5})
+ wincmd t
+ exe $"autocmd WinClosed {s:win} 1close"
+ ]])
+ command('close')
+ assert_alive()
+ end)
+ end)
+
local function with_ext_multigrid(multigrid)
local screen, attrs
before_each(function()
@@ -1448,7 +1581,12 @@ describe('float window', function()
}, win_viewport={
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
- }}
+ },
+ win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 1, bottom = 1, left = 1, right = 1};
+ }
+ }
else
screen:expect{grid=[[
^ |
@@ -1648,7 +1786,12 @@ describe('float window', function()
}, win_viewport={
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
- }}
+ },
+ win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 0, bottom = 0, left = 1, right = 1};
+ }
+ }
else
screen:expect{grid=[[
^ |
@@ -1681,6 +1824,10 @@ describe('float window', function()
}, win_viewport={
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
+ },
+ win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 1, bottom = 1, left = 0, right = 0};
}}
else
screen:expect{grid=[[
@@ -1726,6 +1873,10 @@ describe('float window', function()
}, win_viewport={
[2] = {win = 1000, topline = 0, botline = 6, curline = 5, curcol = 0, linecount = 6, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
+ },
+ win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 0, bottom = 1, left = 0, right = 1};
}}
else
screen:expect{grid=[[
@@ -2256,6 +2407,7 @@ describe('float window', function()
command('hi B0 guibg=Red guifg=Black')
command('hi B1 guifg=White')
+
api.nvim_win_set_config(win, {
title = {{"🦄"}, {"BB", {"B0", "B1"}}}, title_pos = "right",
footer= {{"🦄"}, {"BB", {"B0", "B1"}}}, footer_pos = "right",
@@ -2292,6 +2444,47 @@ describe('float window', function()
|
]]}
end
+ eq({{"🦄"}, {"BB", {"B0", "B1"}}}, api.nvim_win_get_config(win).title)
+ eq({{"🦄"}, {"BB", {"B0", "B1"}}}, api.nvim_win_get_config(win).footer)
+
+ api.nvim_win_set_config(win, {
+ title = {{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, title_pos = "left",
+ footer= {{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, footer_pos = "left",
+ })
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|*6
+ [3:----------------------------------------]|
+ ## grid 2
+ ^ |
+ {0:~ }|*5
+ ## grid 3
+ |
+ ## grid 4
+ {5:╔}🦄{7:BB}{5:═════╗}|
+ {5:║}{1: halloj! }{5:║}|
+ {5:║}{1: BORDAA }{5:║}|
+ {5:╚}🦄{7:BB}{5:═════╝}|
+ ]], float_pos={
+ [4] = { 1001, "NW", 1, 2, 5, true }
+ }, win_viewport={
+ [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ ^ |
+ {0:~ }|
+ {0:~ }{5:╔}🦄{7:BB}{5:═════╗}{0: }|
+ {0:~ }{5:║}{1: halloj! }{5:║}{0: }|
+ {0:~ }{5:║}{1: BORDAA }{5:║}{0: }|
+ {0:~ }{5:╚}🦄{7:BB}{5:═════╝}{0: }|
+ |
+ ]]}
+ end
+ eq({{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, api.nvim_win_get_config(win).title)
+ eq({{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, api.nvim_win_get_config(win).footer)
end)
it('terminates border on edge of viewport when window extends past viewport', function()
@@ -3974,7 +4167,7 @@ describe('float window', function()
if multigrid then
pending("supports second UI without multigrid", function()
- local session2 = helpers.connect(eval('v:servername'))
+ local session2 = n.connect(eval('v:servername'))
print(session2:request("nvim_eval", "2+2"))
local screen2 = Screen.new(40,7)
screen2:attach(nil, session2)
@@ -6169,7 +6362,7 @@ describe('float window', function()
run(on_request, nil, on_setup)
os.remove('Xtest_written')
os.remove('Xtest_written2')
- eq(exited, true)
+ eq(true, exited)
end)
it(':quit two floats in a row', function()
@@ -7872,7 +8065,7 @@ describe('float window', function()
end)
it("correctly redraws when overlaid windows are resized #13991", function()
- helpers.source([[
+ n.source([[
let popup_config = {"relative" : "editor",
\ "width" : 7,
\ "height" : 3,
@@ -7936,7 +8129,7 @@ describe('float window', function()
]])
end
- helpers.source([[
+ n.source([[
let new_popup_config = {"width" : 1, "height" : 3}
let new_border_config = {"width" : 3, "height" : 5}
@@ -7951,7 +8144,7 @@ describe('float window', function()
nnoremap zz <cmd>call Resize()<cr>
]])
- helpers.feed("zz")
+ n.feed("zz")
if multigrid then
screen:expect{grid=[[
## grid 1
@@ -8273,6 +8466,10 @@ describe('float window', function()
}, win_viewport={
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ },
+ win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 2, bottom = 1, left = 1, right = 1};
}}
else
screen:expect{grid=[[
@@ -9101,6 +9298,67 @@ describe('float window', function()
]]}
end
end)
+
+ it('attempt to turn into split with no room', function()
+ eq('Vim(split):E36: Not enough room', pcall_err(command, 'execute "split |"->repeat(&lines)'))
+ command('vsplit | wincmd | | wincmd p')
+ api.nvim_open_win(0, true, {relative = "editor", row = 0, col = 0, width = 5, height = 5})
+ local config = api.nvim_win_get_config(0)
+ eq('editor', config.relative)
+
+ local layout = fn.winlayout()
+ local restcmd = fn.winrestcmd()
+ eq('Vim(wincmd):E36: Not enough room', pcall_err(command, 'wincmd K'))
+ eq('Vim(wincmd):E36: Not enough room', pcall_err(command, 'wincmd J'))
+ eq(layout, fn.winlayout())
+ eq(restcmd, fn.winrestcmd())
+ eq(config, api.nvim_win_get_config(0))
+ end)
+
+ it("error when relative to itself", function()
+ local buf = api.nvim_create_buf(false, true)
+ local config = { relative='win', width=5, height=2, row=3, col=3 }
+ local winid = api.nvim_open_win(buf, false, config)
+ api.nvim_set_current_win(winid)
+ eq("floating window cannot be relative to itself", pcall_err(api.nvim_win_set_config, winid, config))
+ end)
+
+ it("bufpos out of range", function()
+ local buf = api.nvim_create_buf(false, true)
+ api.nvim_buf_set_lines(0, 0, -1, false, {})
+ local config = { relative='win', width=5, height=2, row=0, col=0, bufpos = { 3, 3 } }
+ api.nvim_open_win(buf, false, config)
+ if multigrid then
+ screen:expect({
+ grid = [[
+ ## grid 1
+ [2:----------------------------------------]|*6
+ [3:----------------------------------------]|
+ ## grid 2
+ ^ |
+ {0:~ }|*5
+ ## grid 3
+ |
+ ## grid 4
+ {1: }|
+ {2:~ }|
+ ]], float_pos={
+ [4] = {1001, "NW", 2, 0, 0, true, 50};
+ }, win_viewport={
+ [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ }})
+ else
+ screen:expect({
+ grid = [[
+ {1:^ } |
+ {2:~ }{0: }|
+ {0:~ }|*4
+ |
+ ]]
+ })
+ end
+ end)
end
describe('with ext_multigrid', function()
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index 7f13b6bd03..2712e5ff48 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -1,13 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq
-local command = helpers.command
-local feed_command = helpers.feed_command
-local insert = helpers.insert
-local fn = helpers.fn
-local api = helpers.api
-local exec = helpers.exec
-local assert_alive = helpers.assert_alive
+
+local clear, feed, eq = n.clear, n.feed, t.eq
+local command = n.command
+local feed_command = n.feed_command
+local insert = n.insert
+local fn = n.fn
+local api = n.api
+local exec = n.exec
+local assert_alive = n.assert_alive
local content1 = [[
This is a
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 727dc38829..b7b46ddfae 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -1,13 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
local os = require('os')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command, exec = helpers.command, helpers.exec
-local eval = helpers.eval
-local feed_command, eq = helpers.feed_command, helpers.eq
-local fn = helpers.fn
-local api = helpers.api
-local exec_lua = helpers.exec_lua
+
+local clear, feed, insert = n.clear, n.feed, n.insert
+local command, exec = n.command, n.exec
+local eval = n.eval
+local feed_command, eq = n.feed_command, t.eq
+local fn = n.fn
+local api = n.api
+local exec_lua = n.exec_lua
describe('colorscheme compatibility', function()
before_each(function()
@@ -32,11 +34,6 @@ describe('highlight: `:syntax manual`', function()
screen = Screen.new(20, 5)
screen:attach()
-- syntax highlight for vimscript's "echo"
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { bold = true, foreground = Screen.colors.Brown },
- [2] = { foreground = Screen.colors.Magenta1 },
- })
end)
after_each(function()
@@ -57,8 +54,8 @@ describe('highlight: `:syntax manual`', function()
command('bn')
feed_command('bp')
screen:expect([[
- {1:^echo} {2:1} |
- {0:~ }|*3
+ {15:^echo} {26:1} |
+ {1:~ }|*3
:bp |
]])
end)
@@ -79,8 +76,8 @@ describe('highlight: `:syntax manual`', function()
feed_command('silent bp')
eq('Xtest-functional-ui-highlight.tmp.vim', eval("fnamemodify(bufname('%'), ':t')"))
screen:expect([[
- {1:^echo} {2:1} |
- {0:~ }|*3
+ {15:^echo} {26:1} |
+ {1:~ }|*3
:silent bp |
]])
end)
@@ -92,17 +89,9 @@ describe('highlight defaults', function()
before_each(function()
clear()
screen = Screen.new()
- screen:set_default_attr_ids {
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { reverse = true, bold = true },
- [2] = { reverse = true },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen },
- [5] = { foreground = Screen.colors.Red1, background = Screen.colors.WebGreen },
- [6] = { background = Screen.colors.Red1, foreground = Screen.colors.Grey100 },
- [7] = { foreground = Screen.colors.Red },
- [8] = { foreground = Screen.colors.Blue },
- [9] = { italic = true },
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Red, background = Screen.colors.WebGreen },
+ [101] = { italic = true },
}
screen:attach()
end)
@@ -111,10 +100,10 @@ describe('highlight defaults', function()
feed_command('sp', 'vsp', 'vsp')
screen:expect([[
^ │ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {1:[No Name] }{2:[No Name] [No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {3:[No Name] }{2:[No Name] [No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
@@ -122,11 +111,11 @@ describe('highlight defaults', function()
feed('<c-w>j')
screen:expect([[
│ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
+ {1:~ }│{1:~ }│{1:~ }|*5
{2:[No Name] [No Name] [No Name] }|
^ |
- {0:~ }|*4
- {1:[No Name] }|
+ {1:~ }|*4
+ {3:[No Name] }|
:vsp |
]])
-- note that when moving to a window with small width nvim will increase
@@ -135,30 +124,30 @@ describe('highlight defaults', function()
feed('<c-w>k<c-w>l')
screen:expect([[
│^ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {2:[No Name] }{1:[No Name] }{2:[No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {2:[No Name] }{3:[No Name] }{2:[No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
feed('<c-w>l')
screen:expect([[
│ │^ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {2:[No Name] [No Name] }{1:[No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {2:[No Name] [No Name] }{3:[No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
feed('<c-w>h<c-w>h')
screen:expect([[
^ │ │ |
- {0:~ }│{0:~ }│{0:~ }|*5
- {1:[No Name] }{2:[No Name] [No Name] }|
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {3:[No Name] }{2:[No Name] [No Name] }|
|
- {0:~ }|*4
+ {1:~ }|*4
{2:[No Name] }|
:vsp |
]])
@@ -169,8 +158,8 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|*2
- {3:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
end)
@@ -178,7 +167,7 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
@@ -187,10 +176,10 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
feed(':ls<cr>')
screen:expect([[
- {1: }|
+ {3: }|
:ls |
1 %a "[No Name]" line 1 |
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>') -- skip the "Press ENTER..." state or tests will hang
end)
@@ -201,7 +190,7 @@ describe('highlight defaults', function()
feed('i')
screen:expect([[
^ |
- {0:~ }|*2
+ {1:~ }|*2
-- INSERT -- |
]])
feed('<esc>')
@@ -210,8 +199,8 @@ describe('highlight defaults', function()
feed('i')
screen:expect([[
^ |
- {0:~ }|*2
- {5:-- INSERT --} |
+ {1:~ }|*2
+ {100:-- INSERT --} |
]])
end)
@@ -221,8 +210,8 @@ describe('highlight defaults', function()
feed_command('hi link TmpKeyword ErrorMsg')
insert('neovim')
screen:expect([[
- {6:neovi^m} |
- {0:~ }|*2
+ {9:neovi^m} |
+ {1:~ }|*2
|
]])
feed_command(
@@ -231,7 +220,7 @@ describe('highlight defaults', function()
)
screen:expect([[
neovi^m |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
@@ -240,19 +229,16 @@ describe('highlight defaults', function()
screen:try_resize(53, 4)
screen:expect([[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed_command('hi NonTextAlt guifg=Red')
feed_command('hi! link NonText NonTextAlt')
- screen:expect(
- [[
+ screen:expect([[
^ |
- {0:~ }|*2
+ {19:~ }|*2
:hi! link NonText NonTextAlt |
- ]],
- { [0] = { foreground = Screen.colors.Red } }
- )
+ ]])
end)
it('Cursor after `:hi clear|syntax reset` #6508', function()
@@ -266,47 +252,48 @@ describe('highlight defaults', function()
feed_command('set listchars=space:.,tab:>-,trail:*,eol:¬ list')
insert(' ne \t o\tv im ')
screen:expect([[
- ne{7:.>----.}o{7:>-----}v{7:..}im{7:*^*¬} |
- {7:~ }|*2
+ ne{19:.>----.}o{19:>-----}v{19:..}im{19:*^*¬} |
+ {19:~ }|*2
|
]])
feed_command('highlight Whitespace gui=NONE guifg=#0000FF')
screen:expect([[
- ne{8:.>----.}o{8:>-----}v{8:..}im{8:*^*}{7:¬} |
- {7:~ }|*2
+ ne{18:.>----.}o{18:>-----}v{18:..}im{18:*^*}{19:¬} |
+ {19:~ }|*2
:highlight Whitespace gui=NONE guifg=#0000FF |
]])
end)
it('are sent to UIs', function()
screen:try_resize(53, 4)
+
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
- hl_groups = { EndOfBuffer = 0, MsgSeparator = 1 },
+ hl_groups = { EndOfBuffer = 1, MsgSeparator = 3 },
}
command('highlight EndOfBuffer gui=italic')
screen:expect {
grid = [[
^ |
- {9:~ }|*2
+ {101:~ }|*2
|
]],
- hl_groups = { EndOfBuffer = 9, MsgSeparator = 1 },
+ hl_groups = { EndOfBuffer = 101, MsgSeparator = 3 },
}
command('highlight clear EndOfBuffer')
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
- hl_groups = { EndOfBuffer = 0, MsgSeparator = 1 },
+ hl_groups = { EndOfBuffer = 1, MsgSeparator = 3 },
}
end)
end)
@@ -317,14 +304,6 @@ describe('highlight', function()
it('Visual', function()
local screen = Screen.new(45, 5)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
- [2] = { bold = true, foreground = Screen.colors.Blue },
- [3] = { bold = true },
- [4] = { reverse = true, bold = true },
- [5] = { reverse = true },
- [6] = { background = Screen.colors.Grey90 },
- })
insert([[
line1 foo bar
abcdefghijklmnopqrs
@@ -337,137 +316,136 @@ describe('highlight', function()
command('set guicursor=a:block-blinkon0')
feed('V')
screen:expect([[
- {1: }^l{1:ine1 foo bar} │{1: line1 foo bar} |
+ {17: }^l{17:ine1 foo bar} │{17: line1 foo bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL LINE --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL LINE --} |
]])
feed('<Esc>$vhhh')
screen:expect([[
- line1 foo^ {1:bar} │ line1 foo{1: bar} |
+ line1 foo^ {17:bar} │ line1 foo{17: bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
-- Vertical cursor: highlights char-at-cursor. #8983
command('set guicursor=a:block-blinkon175')
screen:expect([[
- line1 foo{1:^ bar} │ line1 foo{1: bar} |
+ line1 foo{17:^ bar} │ line1 foo{17: bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
command('set selection=exclusive')
screen:expect([[
- line1 foo{1:^ ba}r │ line1 foo{1: ba}r |
+ line1 foo{17:^ ba}r │ line1 foo{17: ba}r |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
feed('o')
screen:expect([[
- line1 foo{1: ba}^r │ line1 foo{1: ba}r |
+ line1 foo{17: ba}^r │ line1 foo{17: ba}r |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL --} |
]])
feed('V')
screen:expect([[
- {1: line1 foo ba^r} │{1: line1 foo bar} |
+ {17: line1 foo ba^r} │{17: line1 foo bar} |
abcdefghijklmnopqrs │abcdefghijklmnopqrs |
ABCDEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL LINE --} |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL LINE --} |
]])
command('set cursorcolumn')
feed('<C-V>')
screen:expect([[
- line1 foo{1: ba}^r │ line1 foo{1: ba}r |
- abcdefghijklmn{6:o}pqrs │abcdefghijklmnopqrs |
- ABCDEFGHIJKLMN{6:O}PQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ line1 foo{17: ba}^r │ line1 foo{17: ba}r |
+ abcdefghijklmn{21:o}pqrs │abcdefghijklmnopqrs |
+ ABCDEFGHIJKLMN{21:O}PQRS │ABCDEFGHIJKLMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
command('set selection&')
screen:expect([[
- line1 foo{1: ba^r} │ line1 foo{1: bar} |
- abcdefghijklmn{6:o}pqrs │abcdefghijklmnopqrs |
- ABCDEFGHIJKLMN{6:O}PQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ line1 foo{17: ba^r} │ line1 foo{17: bar} |
+ abcdefghijklmn{21:o}pqrs │abcdefghijklmnopqrs |
+ ABCDEFGHIJKLMN{21:O}PQRS │ABCDEFGHIJKLMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('^')
screen:expect([[
- {1:^line1 foo }bar │ {1:line1 foo }bar |
- ab{6:c}defghijklmnopqrs │abcdefghijklmnopqrs |
- AB{6:C}DEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:^line1 foo }bar │ {17:line1 foo }bar |
+ ab{21:c}defghijklmnopqrs │abcdefghijklmnopqrs |
+ AB{21:C}DEFGHIJKLMNOPQRS │ABCDEFGHIJKLMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('2j')
screen:expect([[
- {1:line1 foo }bar │ {1:line1 foo }bar |
- ab{1:cdefghijkl}mnopqrs │ab{1:cdefghijkl}mnopqrs |
- AB{1:^CDEFGHIJKL}MNOPQRS │AB{1:CDEFGHIJKL}MNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:line1 foo }bar │ {17:line1 foo }bar |
+ ab{17:cdefghijkl}mnopqrs │ab{17:cdefghijkl}mnopqrs |
+ AB{17:^CDEFGHIJKL}MNOPQRS │AB{17:CDEFGHIJKL}MNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
command('set nocursorcolumn')
feed('O')
screen:expect([[
- {1:line1 foo }bar │ {1:line1 foo }bar |
- ab{1:cdefghijkl}mnopqrs │ab{1:cdefghijkl}mnopqrs |
- AB{1:CDEFGHIJK^L}MNOPQRS │AB{1:CDEFGHIJKL}MNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:line1 foo }bar │ {17:line1 foo }bar |
+ ab{17:cdefghijkl}mnopqrs │ab{17:cdefghijkl}mnopqrs |
+ AB{17:CDEFGHIJK^L}MNOPQRS │AB{17:CDEFGHIJKL}MNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
command('set selection=exclusive')
screen:expect([[
- {1:line1 foo} bar │ {1:line1 foo} bar |
- ab{1:cdefghijk}lmnopqrs │ab{1:cdefghijk}lmnopqrs |
- AB{1:CDEFGHIJK}^LMNOPQRS │AB{1:CDEFGHIJK}LMNOPQRS |
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {3:-- VISUAL BLOCK --} |
+ {17:line1 foo} bar │ {17:line1 foo} bar |
+ ab{17:cdefghijk}lmnopqrs │ab{17:cdefghijk}lmnopqrs |
+ AB{17:CDEFGHIJK}^LMNOPQRS │AB{17:CDEFGHIJK}LMNOPQRS |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- VISUAL BLOCK --} |
]])
end)
it('cterm=standout gui=standout', function()
local screen = Screen.new(20, 5)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = {
- standout = true,
+ screen:add_extra_attr_ids {
+ [100] = {
+ foreground = Screen.colors.Blue1,
bold = true,
+ background = Screen.colors.Grey90,
underline = true,
- background = Screen.colors.Gray90,
- foreground = Screen.colors.Blue1,
+ standout = true,
},
- [3] = { standout = true, underline = true, background = Screen.colors.Gray90 },
- })
+ [101] = { underline = true, standout = true, background = Screen.colors.Grey90 },
+ }
feed_command('hi CursorLine cterm=standout,underline gui=standout,underline')
feed_command('set cursorline')
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
feed('i\t abcd <cr>\t abcd <cr><esc>k')
screen:expect([[
{1:>-------.}abcd{1:*¬} |
- {2:^>-------.}{3:abcd}{2:*¬}{3: }|
+ {100:^>-------.}{101:abcd}{100:*¬}{101: }|
{1:¬} |
{1:~ }|
|
@@ -504,16 +482,13 @@ describe('highlight', function()
it('nocombine', function()
local screen = Screen.new(25, 6)
- screen:set_default_attr_ids {
- [1] = { foreground = Screen.colors.SlateBlue, underline = true },
- [2] = { bold = true, foreground = Screen.colors.Blue1 },
- [3] = { underline = true, reverse = true, foreground = Screen.colors.SlateBlue },
- [4] = {
- background = Screen.colors.Yellow,
- reverse = true,
+ screen:add_extra_attr_ids {
+ [100] = { underline = true, reverse = true, foreground = Screen.colors.SlateBlue },
+ [101] = {
foreground = Screen.colors.SlateBlue,
+ reverse = true,
+ background = Screen.colors.Yellow,
},
- [5] = { foreground = Screen.colors.Red },
}
screen:attach()
feed_command('syntax on')
@@ -526,9 +501,9 @@ describe('highlight', function()
]])
screen:expect {
grid = [[
- {1:foobar} |*2
+ {28:foobar} |*2
^ |
- {2:~ }|*2
+ {1:~ }|*2
|
]],
}
@@ -536,21 +511,21 @@ describe('highlight', function()
feed('/foo')
screen:expect {
grid = [[
- {3:foo}{1:bar} |
- {4:foo}{1:bar} |
+ {100:foo}{28:bar} |
+ {101:foo}{28:bar} |
|
- {2:~ }|*2
+ {1:~ }|*2
/foo^ |
]],
}
feed('<cr>')
screen:expect {
grid = [[
- {4:^foo}{1:bar} |
- {4:foo}{1:bar} |
+ {101:^foo}{28:bar} |
+ {101:foo}{28:bar} |
|
- {2:~ }|*2
- {5:search hit...uing at TOP} |
+ {1:~ }|*2
+ {19:search hit...uing at TOP} |
]],
}
end)
@@ -660,44 +635,40 @@ describe("'listchars' highlight", function()
end)
it("'cursorline' and 'cursorcolumn'", function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { background = Screen.colors.Grey90 },
- })
feed_command('highlight clear ModeMsg')
feed_command('set cursorline')
feed('i')
screen:expect([[
- {1:^ }|
- {0:~ }|*3
+ {21:^ }|
+ {1:~ }|*3
-- INSERT -- |
]])
feed('abcdefg<cr>kkasdf')
screen:expect([[
abcdefg |
- {1:kkasdf^ }|
- {0:~ }|*2
+ {21:kkasdf^ }|
+ {1:~ }|*2
-- INSERT -- |
]])
feed('<esc>')
screen:expect([[
abcdefg |
- {1:kkasd^f }|
- {0:~ }|*2
+ {21:kkasd^f }|
+ {1:~ }|*2
|
]])
feed_command('set nocursorline')
screen:expect([[
abcdefg |
kkasd^f |
- {0:~ }|*2
+ {1:~ }|*2
:set nocursorline |
]])
feed('k')
screen:expect([[
abcde^fg |
kkasdf |
- {0:~ }|*2
+ {1:~ }|*2
:set nocursorline |
]])
feed('jjji<cr><cr><cr><esc>')
@@ -711,42 +682,27 @@ describe("'listchars' highlight", function()
feed_command('set cursorcolumn')
feed('kkiabcdefghijk<esc>hh')
screen:expect([[
- kkasd {1: } |
- {1:abcdefgh^ijk }|
- {1: } |
- f {1: } |
+ kkasd {21: } |
+ {21:abcdefgh^ijk }|
+ {21: } |
+ f {21: } |
|
]])
feed('khh')
screen:expect([[
- {1:kk^asd }|
- ab{1:c}defghijk |
- {1: } |
- f {1: } |
+ {21:kk^asd }|
+ ab{21:c}defghijk |
+ {21: } |
+ f {21: } |
|
]])
end)
it("'cursorline' and with 'listchars' option", function()
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Grey90 },
- [2] = {
- foreground = Screen.colors.Red,
- background = Screen.colors.Grey90,
- },
- [3] = {
- background = Screen.colors.Grey90,
- foreground = Screen.colors.Blue,
- bold = true,
- },
- [4] = {
- foreground = Screen.colors.Blue,
- bold = true,
- },
- [5] = {
- foreground = Screen.colors.Red,
- },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
+ [101] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.Grey90 },
+ }
feed_command('highlight clear ModeMsg')
feed_command('highlight Whitespace guifg=#FF0000')
feed_command('set cursorline')
@@ -754,73 +710,70 @@ describe("'listchars' highlight", function()
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
feed('i\t abcd <cr>\t abcd <cr><esc>k')
screen:expect([[
- {5:>-------.}abcd{5:*}{4:¬} |
- {2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
- {4:¬} |
- {4:~ }|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {100:^>-------.}{21:abcd}{100:*}{101:¬}{21: }|
+ {1:¬} |
+ {1:~ }|
|
]])
feed('k')
screen:expect([[
- {2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {100:^>-------.}{21:abcd}{100:*}{101:¬}{21: }|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
|
]])
feed_command('set nocursorline')
screen:expect([[
- {5:^>-------.}abcd{5:*}{4:¬} |
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {19:^>-------.}abcd{19:*}{1:¬} |
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
:set nocursorline |
]])
feed_command('set nowrap')
feed('ALorem ipsum dolor sit amet<ESC>0')
screen:expect([[
- {5:^>-------.}abcd{5:.}Lorem{4:>}|
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {19:^>-------.}abcd{19:.}Lorem{1:>}|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
|
]])
feed_command('set cursorline')
screen:expect([[
- {2:^>-------.}{1:abcd}{2:.}{1:Lorem}{3:>}|
- {5:>-------.}abcd{5:*}{4:¬} |
- {4:¬} |
- {4:~ }|
+ {100:^>-------.}{21:abcd}{100:.}{21:Lorem}{101:>}|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {1:¬} |
+ {1:~ }|
:set cursorline |
]])
feed('$')
screen:expect([[
- {3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
- {4:<} |*2
- {4:~ }|
+ {101:<}{21:r}{100:.}{21:sit}{100:.}{21:ame^t}{101:¬}{21: }|
+ {1:<} |*2
+ {1:~ }|
:set cursorline |
]])
feed('G')
screen:expect([[
- {5:>-------.}abcd{5:.}Lorem{4:>}|
- {5:>-------.}abcd{5:*}{4:¬} |
- {3:^¬}{1: }|
- {4:~ }|
+ {19:>-------.}abcd{19:.}Lorem{1:>}|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {101:^¬}{21: }|
+ {1:~ }|
:set cursorline |
]])
end)
it("'listchar' with wrap", function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- })
feed_command('set wrap')
feed_command('set listchars=eol:¬,precedes:< list')
feed('90ia<esc>')
screen:expect([[
- {0:<}aaaaaaaaaaaaaaaaaaa|
+ {1:<}aaaaaaaaaaaaaaaaaaa|
aaaaaaaaaaaaaaaaaaaa|*2
- aaaaaaaaa^a{0:¬} |
+ aaaaaaaaa^a{1:¬} |
|
]])
feed('0')
@@ -832,16 +785,16 @@ describe("'listchars' highlight", function()
end)
it("'listchar' in visual mode", function()
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Grey90 },
- [2] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
- [3] = { background = Screen.colors.Grey90, foreground = Screen.colors.Blue, bold = true },
- [4] = { foreground = Screen.colors.Blue, bold = true },
- [5] = { foreground = Screen.colors.Red },
- [6] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
- [7] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Red },
- [8] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Blue, bold = true },
- })
+ screen:add_extra_attr_ids {
+ [100] = {
+ foreground = Screen.colors.Blue1,
+ bold = true,
+ background = Screen.colors.LightGray,
+ },
+ [101] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
+ [102] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.Grey90 },
+ [103] = { foreground = Screen.colors.Red, background = Screen.colors.LightGray },
+ }
command('highlight clear ModeMsg')
command('highlight Whitespace guifg=#FF0000')
command('set cursorline')
@@ -850,45 +803,42 @@ describe("'listchars' highlight", function()
command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
feed('i\t abcd <cr>\t abcd Lorem ipsum dolor sit amet<cr><esc>kkk0')
screen:expect([[
- {2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
- {5:>-------.}abcd{5:.}Lorem{4:>}|
- {4:¬} |
- {4:~ }|
+ {101:^>-------.}{21:abcd}{101:*}{102:¬}{21: }|
+ {19:>-------.}abcd{19:.}Lorem{1:>}|
+ {1:¬} |
+ {1:~ }|
|
]])
feed('lllvj')
screen:expect([[
- {5:>-------.}a{6:bcd}{7:*}{8:¬} |
- {7:>-------.}{6:a}^bcd{5:.}Lorem{4:>}|
- {4:¬} |
- {4:~ }|
+ {19:>-------.}a{17:bcd}{103:*}{100:¬} |
+ {103:>-------.}{17:a}^bcd{19:.}Lorem{1:>}|
+ {1:¬} |
+ {1:~ }|
-- VISUAL -- |
]])
feed('<esc>V')
screen:expect([[
- {5:>-------.}abcd{5:*}{4:¬} |
- {7:>-------.}{6:a}^b{6:cd}{7:.}{6:Lorem}{4:>}|
- {4:¬} |
- {4:~ }|
+ {19:>-------.}abcd{19:*}{1:¬} |
+ {103:>-------.}{17:a}^b{17:cd}{103:.}{17:Lorem}{1:>}|
+ {1:¬} |
+ {1:~ }|
-- VISUAL LINE -- |
]])
feed('<esc>$')
screen:expect([[
- {4:<} |
- {3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
- {4:<} |
- {4:~ }|
+ {1:<} |
+ {102:<}{21:r}{101:.}{21:sit}{101:.}{21:ame^t}{102:¬}{21: }|
+ {1:<} |
+ {1:~ }|
|
]])
end)
it("'cursorline' with :match", function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { background = Screen.colors.Grey90 },
- [2] = { foreground = Screen.colors.Red },
- [3] = { foreground = Screen.colors.X11Green, background = Screen.colors.Red1 },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Lime, background = Screen.colors.Red },
+ }
feed_command('highlight clear ModeMsg')
feed_command('highlight Whitespace guifg=#FF0000')
feed_command('highlight Error guifg=#00FF00')
@@ -896,19 +846,19 @@ describe("'listchars' highlight", function()
feed('ia \t bc \t <esc>')
screen:expect([[
a bc ^ |
- {0:~ }|*3
+ {1:~ }|*3
|
]])
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
screen:expect([[
- a{2:.>-----.}bc{2:*>---*^*}{0:¬} |
- {0:~ }|*3
+ a{19:.>-----.}bc{19:*>---*^*}{1:¬} |
+ {1:~ }|*3
|
]])
feed_command('match Error /\\s\\+$/')
screen:expect([[
- a{2:.>-----.}bc{3:*>---*^*}{0:¬} |
- {0:~ }|*3
+ a{19:.>-----.}bc{100:*>---*^*}{1:¬} |
+ {1:~ }|*3
|
]])
end)
@@ -919,15 +869,10 @@ describe('CursorLine and CursorLineNr highlights', function()
it('overridden by Error, ColorColumn if fg not set', function()
local screen = Screen.new(50, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.SlateBlue },
- [2] = { bold = true, foreground = Screen.colors.Brown },
- [3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [4] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Gray90 },
- [5] = { background = Screen.colors.Gray90 },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.LightRed },
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.LightRed },
+ [101] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Grey90 },
+ }
screen:attach()
command('filetype on')
@@ -935,32 +880,32 @@ describe('CursorLine and CursorLineNr highlights', function()
command('set cursorline ft=json')
feed('i{<cr>"a" : abc // 10;<cr>}<cr><esc>')
screen:expect([[
- {1:{} |
- "{2:a}" : {3:abc} {3:// 10;} |
- {1:}} |
- {5:^ }|
+ {16:{} |
+ "{15:a}" : {9:abc} {9:// 10;} |
+ {16:}} |
+ {21:^ }|
|
]])
command('set colorcolumn=3')
feed('i <esc>')
screen:expect([[
- {1:{} {7: } |
- "{2:a}{7:"} : {3:abc} {3:// 10;} |
- {1:}} {7: } |
- {5: ^ }{7: }{5: }|
+ {16:{} {100: } |
+ "{15:a}{100:"} : {9:abc} {9:// 10;} |
+ {16:}} {100: } |
+ {21: ^ }{100: }{21: }|
|
]])
end)
it("overridden by NonText in 'showbreak' characters", function()
local screen = Screen.new(20, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Yellow, background = Screen.colors.Blue },
- [2] = { foreground = Screen.colors.Black, background = Screen.colors.White },
- [3] = { foreground = Screen.colors.Yellow, background = Screen.colors.White },
- [4] = { foreground = Screen.colors.Yellow },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Yellow1 },
+ [101] = { foreground = Screen.colors.Yellow1, background = Screen.colors.Blue },
+ [102] = { foreground = Screen.colors.Grey0, background = Screen.colors.Grey100 },
+ [103] = { foreground = Screen.colors.Yellow1, background = Screen.colors.Grey100 },
+ }
screen:attach()
feed_command('set wrap cursorline')
@@ -973,46 +918,45 @@ describe('CursorLine and CursorLineNr highlights', function()
feed('30iø<esc>o<esc>30ia<esc>')
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {1:>>>}øøøøøøøøøø |
- {2:aaaaaaaaaaaaaaaaaaaa}|
- {1:>>>}{2:aaaaaaaaa^a }|
+ {101:>>>}øøøøøøøøøø |
+ {102:aaaaaaaaaaaaaaaaaaaa}|
+ {101:>>>}{102:aaaaaaaaa^a }|
|
]])
feed('k')
screen:expect([[
- {2:øøøøøøøøøøøøøøøøøøøø}|
- {1:>>>}{2:øøøøøøøøø^ø }|
+ {102:øøøøøøøøøøøøøøøøøøøø}|
+ {101:>>>}{102:øøøøøøøøø^ø }|
aaaaaaaaaaaaaaaaaaaa|
- {1:>>>}aaaaaaaaaa |
+ {101:>>>}aaaaaaaaaa |
|
]])
feed_command('highlight NonText guibg=NONE')
screen:expect([[
- {2:øøøøøøøøøøøøøøøøøøøø}|
- {3:>>>}{2:øøøøøøøøø^ø }|
+ {102:øøøøøøøøøøøøøøøøøøøø}|
+ {103:>>>}{102:øøøøøøøøø^ø }|
aaaaaaaaaaaaaaaaaaaa|
- {4:>>>}aaaaaaaaaa |
+ {100:>>>}aaaaaaaaaa |
|
]])
feed_command('set nocursorline')
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {4:>>>}øøøøøøøøø^ø |
+ {100:>>>}øøøøøøøøø^ø |
aaaaaaaaaaaaaaaaaaaa|
- {4:>>>}aaaaaaaaaa |
+ {100:>>>}aaaaaaaaaa |
:set nocursorline |
]])
end)
it("'cursorlineopt' screenline", function()
local screen = Screen.new(20, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Black, background = Screen.colors.White },
- [2] = { foreground = Screen.colors.Yellow },
- [3] = { foreground = Screen.colors.Red, background = Screen.colors.Green },
- [4] = { foreground = Screen.colors.Green, background = Screen.colors.Red },
- [5] = { bold = true }, -- ModeMsg
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Yellow },
+ [101] = { foreground = Screen.colors.Red, background = Screen.colors.WebGreen },
+ [102] = { foreground = Screen.colors.Black, background = Screen.colors.Grey100 },
+ [103] = { foreground = Screen.colors.WebGreen, background = Screen.colors.Red },
+ }
screen:attach()
command('set wrap cursorline cursorlineopt=screenline')
@@ -1029,107 +973,107 @@ describe('CursorLine and CursorLineNr highlights', function()
-- CursorLine should not apply to 'showbreak' when 'cursorlineopt' contains "screenline"
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {2:>>>}øøøøøøøøøø |
+ {100:>>>}øøøøøøøøøø |
aaaaaaaaaaaaaaaaaaaa|
- {2:>>>}{1:aaaaaaaaa^a }|
+ {100:>>>}{102:aaaaaaaaa^a }|
|
]])
feed('gk')
screen:expect([[
øøøøøøøøøøøøøøøøøøøø|
- {2:>>>}øøøøøøøøøø |
- {1:aaaaaaaaaaaa^aaaaaaaa}|
- {2:>>>}aaaaaaaaaa |
+ {100:>>>}øøøøøøøøøø |
+ {102:aaaaaaaaaaaa^aaaaaaaa}|
+ {100:>>>}aaaaaaaaaa |
|
]])
feed('k')
screen:expect([[
- {1:øøøøøøøøøøøø^øøøøøøøø}|
- {2:>>>}øøøøøøøøøø |
+ {102:øøøøøøøøøøøø^øøøøøøøø}|
+ {100:>>>}øøøøøøøøøø |
aaaaaaaaaaaaaaaaaaaa|
- {2:>>>}aaaaaaaaaa |
+ {100:>>>}aaaaaaaaaa |
|
]])
-- CursorLineNr should not apply to line number when 'cursorlineopt' does not contain "number"
command('set relativenumber numberwidth=2')
screen:expect([[
- {3:0 }{1:øøøøøøøøøøøø^øøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {101:0 }{102:øøøøøøøøøøøø^øøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
-- CursorLineNr should apply to line number when 'cursorlineopt' contains "number"
command('set cursorlineopt+=number')
screen:expect([[
- {4:0 }{1:øøøøøøøøøøøø^øøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }{102:øøøøøøøøøøøø^øøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
feed('gj')
screen:expect([[
- {4:0 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}{1:øøøøøøøøø^øøø }|
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}{102:øøøøøøøøø^øøø }|
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
feed('gj')
screen:expect([[
- {3:1 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {4:0 }{1:aaaaaaaaaaaa^aaaaaa}|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {101:1 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {103:0 }{102:aaaaaaaaaaaa^aaaaaa}|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
feed('gj')
screen:expect([[
- {3:1 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {4:0 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}{1:aaaaaaaaa^aaa }|
+ {101:1 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {103:0 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}{102:aaaaaaaaa^aaa }|
|
]])
-- updated in Insert mode
feed('I')
screen:expect([[
- {3:1 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {4:0 }{1:^aaaaaaaaaaaaaaaaaa}|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {101:1 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {103:0 }{102:^aaaaaaaaaaaaaaaaaa}|
+ {101: }{100:>>>}aaaaaaaaaaaa |
{5:-- INSERT --} |
]])
feed('<Esc>gg')
screen:expect([[
- {4:0 }{1:^øøøøøøøøøøøøøøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }{102:^øøøøøøøøøøøøøøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
|
]])
command('inoremap <F2> <Cmd>call cursor(1, 1)<CR>')
feed('A')
screen:expect([[
- {4:0 }øøøøøøøøøøøøøøøøøø|
- {3: }{2:>>>}{1:øøøøøøøøøøøø^ }|
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }øøøøøøøøøøøøøøøøøø|
+ {101: }{100:>>>}{102:øøøøøøøøøøøø^ }|
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
{5:-- INSERT --} |
]])
feed('<F2>')
screen:expect([[
- {4:0 }{1:^øøøøøøøøøøøøøøøøøø}|
- {3: }{2:>>>}øøøøøøøøøøøø |
- {3:1 }aaaaaaaaaaaaaaaaaa|
- {3: }{2:>>>}aaaaaaaaaaaa |
+ {103:0 }{102:^øøøøøøøøøøøøøøøøøø}|
+ {101: }{100:>>>}øøøøøøøøøøøø |
+ {101:1 }aaaaaaaaaaaaaaaaaa|
+ {101: }{100:>>>}aaaaaaaaaaaa |
{5:-- INSERT --} |
]])
end)
@@ -1137,22 +1081,16 @@ describe('CursorLine and CursorLineNr highlights', function()
-- oldtest: Test_cursorline_after_yank()
it('always updated. vim-patch:8.1.0849', function()
local screen = Screen.new(50, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.SlateBlue },
- [2] = { bold = true, foreground = Screen.colors.Brown },
- [3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [4] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Gray90 },
- [5] = { background = Screen.colors.Gray90 },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.LightRed },
- [8] = { foreground = Screen.colors.Brown },
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.LightRed },
+ [101] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Grey90 },
+ }
screen:attach()
command('set cursorline relativenumber')
command('call setline(1, ["","1","2","3",""])')
feed('Gy3k')
screen:expect([[
- {2: 0 }{5:^1 }|
+ {15: 0 }{21:^1 }|
{8: 1 }2 |
{8: 2 }3 |
{8: 3 } |
@@ -1162,7 +1100,7 @@ describe('CursorLine and CursorLineNr highlights', function()
screen:expect([[
{8: 2 }1 |
{8: 1 }2 |
- {2: 0 }{5:^3 }|
+ {15: 0 }{21:^3 }|
{8: 1 } |
4 lines yanked |
]])
@@ -1171,37 +1109,25 @@ describe('CursorLine and CursorLineNr highlights', function()
-- oldtest: Test_cursorline_with_visualmode()
it('with visual area. vim-patch:8.1.1001', function()
local screen = Screen.new(50, 5)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.SlateBlue },
- [2] = { bold = true, foreground = Screen.colors.Brown },
- [3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [4] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Gray90 },
- [5] = { background = Screen.colors.Gray90 },
- [6] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.LightRed },
- [8] = { foreground = Screen.colors.Brown },
- [9] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
- [10] = { bold = true },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.SlateBlue, background = Screen.colors.Grey90 },
+ [101] = { background = Screen.colors.LightRed },
+ }
screen:attach()
command('set cursorline')
command('call setline(1, repeat(["abc"], 50))')
feed('V<C-f>zbkkjk')
screen:expect([[
- {9:abc} |
- ^a{9:bc} |
+ {17:abc} |
+ ^a{17:bc} |
abc |*2
- {10:-- VISUAL LINE --} |
+ {5:-- VISUAL LINE --} |
]])
end)
-- oldtest: Test_cursorline_callback()
it('is updated if cursor is moved up from timer vim-patch:8.2.4591', function()
local screen = Screen.new(50, 8)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Gray90 }, -- CursorLine
- [2] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText
- })
screen:attach()
exec([[
call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd'])
@@ -1219,8 +1145,8 @@ describe('CursorLine and CursorLineNr highlights', function()
aaaaa |
bbbbb |
ccccc |
- {1:^ddddd }|
- {2:~ }|*3
+ {21:^ddddd }|
+ {1:~ }|*3
|
]],
timeout = 100,
@@ -1228,10 +1154,10 @@ describe('CursorLine and CursorLineNr highlights', function()
screen:expect({
grid = [[
aaaaa |
- {1:^bbbbb }|
+ {21:^bbbbb }|
ccccc |
ddddd |
- {2:~ }|*3
+ {1:~ }|*3
|
]],
})
@@ -1239,17 +1165,10 @@ describe('CursorLine and CursorLineNr highlights', function()
it('with split windows in diff mode', function()
local screen = Screen.new(50, 12)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { bold = true, background = Screen.colors.Red },
- [3] = { background = Screen.colors.LightMagenta },
- [4] = { reverse = true },
- [5] = { background = Screen.colors.LightBlue },
- [6] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
- [7] = { background = Screen.colors.Red, foreground = Screen.colors.White },
- [8] = { bold = true, foreground = Screen.colors.Blue1 },
- [9] = { bold = true, reverse = true },
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.Plum1, underline = true },
+ [101] = { background = Screen.colors.Red1, bold = true, underline = true },
+ }
screen:attach()
command('hi CursorLine ctermbg=red ctermfg=white guibg=red guifg=white')
@@ -1264,26 +1183,26 @@ describe('CursorLine and CursorLineNr highlights', function()
feed('<esc>gg')
command('windo diffthis')
screen:expect([[
- {1: }{7:line 1 some text }│{1: }{7:^line 1 some text }|
- {1: }{3:line 2 mo}{2:Re text!}{3: }│{1: }{3:line 2 mo}{2:re text}{3: }|
- {1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |*2
- {1: }last line ... │{1: }last line ... |
- {1: } │{1: } |
- {8:~ }│{8:~ }|*3
- {4:[No Name] [+] }{9:[No Name] [+] }|
+ {7: }{9:line 1 some text }│{7: }{9:^line 1 some text }|
+ {7: }{4:line 2 mo}{27:Re text!}{4: }│{7: }{4:line 2 mo}{27:re text}{4: }|
+ {7: }{22:extra line! }│{7: }{23:----------------------}|
+ {7: }extra line! │{7: }extra line! |*2
+ {7: }last line ... │{7: }last line ... |
+ {7: } │{7: } |
+ {1:~ }│{1:~ }|*3
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]])
feed('jjjjj')
screen:expect([[
- {1: }line 1 some text │{1: }line 1 some text |
- {1: }{3:line 2 mo}{2:Re text!}{3: }│{1: }{3:line 2 mo}{2:re text}{3: }|
- {1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |*2
- {1: }last line ... │{1: }last line ... |
- {1: }{7: }│{1: }{7:^ }|
- {8:~ }│{8:~ }|*3
- {4:[No Name] [+] }{9:[No Name] [+] }|
+ {7: }line 1 some text │{7: }line 1 some text |
+ {7: }{4:line 2 mo}{27:Re text!}{4: }│{7: }{4:line 2 mo}{27:re text}{4: }|
+ {7: }{22:extra line! }│{7: }{23:----------------------}|
+ {7: }extra line! │{7: }extra line! |*2
+ {7: }last line ... │{7: }last line ... |
+ {7: }{9: }│{7: }{9:^ }|
+ {1:~ }│{1:~ }|*3
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]])
@@ -1291,53 +1210,25 @@ describe('CursorLine and CursorLineNr highlights', function()
-- Rendered as underline in a diff-line. #9028
command('hi CursorLine ctermbg=red ctermfg=NONE guibg=red guifg=NONE')
feed('kkkk')
- screen:expect(
- [[
- {1: }line 1 some text │{1: }line 1 some text |
- {1: }{11:line 2 mo}{12:Re text!}{11: }│{1: }{11:^line 2 mo}{12:re text}{11: }|
- {1: }{5:extra line! }│{1: }{6:----------------------}|
- {1: }extra line! │{1: }extra line! |*2
- {1: }last line ... │{1: }last line ... |
- {1: } │{1: } |
- {8:~ }│{8:~ }|*3
- {4:[No Name] [+] }{9:[No Name] [+] }|
+ screen:expect([[
+ {7: }line 1 some text │{7: }line 1 some text |
+ {7: }{100:line 2 mo}{101:Re text!}{100: }│{7: }{100:^line 2 mo}{101:re text}{100: }|
+ {7: }{22:extra line! }│{7: }{23:----------------------}|
+ {7: }extra line! │{7: }extra line! |*2
+ {7: }last line ... │{7: }last line ... |
+ {7: } │{7: } |
+ {1:~ }│{1:~ }|*3
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
- ]],
- {
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { bold = true, background = Screen.colors.Red },
- [3] = { background = Screen.colors.LightMagenta },
- [4] = { reverse = true },
- [5] = { background = Screen.colors.LightBlue },
- [6] = {
- background = Screen.colors.LightCyan1,
- bold = true,
- foreground = Screen.colors.Blue1,
- },
- [7] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [8] = { bold = true, foreground = Screen.colors.Blue1 },
- [9] = { bold = true, reverse = true },
- [10] = { bold = true },
- [11] = { underline = true, background = Screen.colors.LightMagenta },
- [12] = { bold = true, underline = true, background = Screen.colors.Red },
- }
- )
+ ]])
end)
-- oldtest: Test_diff_with_cursorline_number()
it('CursorLineNr shows correctly just below filler lines', function()
local screen = Screen.new(50, 12)
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
- [2] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.LightBlue },
- [5] = { background = Screen.colors.Red, foreground = Screen.colors.White },
- [6] = { background = Screen.colors.White, bold = true, foreground = Screen.colors.Black },
- [7] = { bold = true, foreground = Screen.colors.Blue1 },
- [8] = { bold = true, reverse = true },
- [9] = { foreground = Screen.colors.Brown },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Black, bold = true, background = Screen.colors.Grey100 },
+ }
screen:attach()
command('hi CursorLine guibg=red guifg=white')
@@ -1350,22 +1241,22 @@ describe('CursorLine and CursorLineNr highlights', function()
command('windo diffthis')
command('1wincmd w')
screen:expect([[
- {1: }{9: }{2:-------------------}│{1: }{9: 1 }{4:baz }|
- {1: }{6: 1 }{5:^foo }│{1: }{6: 2 }{5:foo }|
- {1: }{9: 2 }foo │{1: }{9: 3 }foo |
- {1: }{9: 3 }bar │{1: }{9: 4 }bar |
- {7:~ }│{7:~ }|*6
- {8:[No Name] [+] }{3:[No Name] [+] }|
+ {7: }{8: }{23:-------------------}│{7: }{8: 1 }{22:baz }|
+ {7: }{100: 1 }{9:^foo }│{7: }{100: 2 }{9:foo }|
+ {7: }{8: 2 }foo │{7: }{8: 3 }foo |
+ {7: }{8: 3 }bar │{7: }{8: 4 }bar |
+ {1:~ }│{1:~ }|*6
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
command('set cursorlineopt=number')
screen:expect([[
- {1: }{9: }{2:-------------------}│{1: }{9: 1 }{4:baz }|
- {1: }{6: 1 }^foo │{1: }{6: 2 }{5:foo }|
- {1: }{9: 2 }foo │{1: }{9: 3 }foo |
- {1: }{9: 3 }bar │{1: }{9: 4 }bar |
- {7:~ }│{7:~ }|*6
- {8:[No Name] [+] }{3:[No Name] [+] }|
+ {7: }{8: }{23:-------------------}│{7: }{8: 1 }{22:baz }|
+ {7: }{100: 1 }^foo │{7: }{100: 2 }{9:foo }|
+ {7: }{8: 2 }foo │{7: }{8: 3 }foo |
+ {7: }{8: 3 }bar │{7: }{8: 4 }bar |
+ {1:~ }│{1:~ }|*6
+ {3:[No Name] [+] }{2:[No Name] [+] }|
|
]])
end)
@@ -1376,11 +1267,9 @@ describe('CursorColumn highlight', function()
before_each(function()
clear()
screen = Screen.new(50, 8)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Gray90 }, -- CursorColumn
- [2] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText
- [3] = { bold = true }, -- ModeMsg
- })
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.Blue1 },
+ }
screen:attach()
end)
@@ -1391,31 +1280,31 @@ describe('CursorColumn highlight', function()
call cursor(2, 2)
]])
screen:expect([[
- 1234567{1:8}9 |
+ 1234567{21:8}9 |
a ^ b |
- {2:~ }|*5
+ {1:~ }|*5
|
]])
feed('i')
screen:expect([[
- 1{1:2}3456789 |
+ 1{21:2}3456789 |
a^ b |
- {2:~ }|*5
- {3:-- INSERT --} |
+ {1:~ }|*5
+ {5:-- INSERT --} |
]])
feed('<C-O>')
screen:expect([[
- 1234567{1:8}9 |
+ 1234567{21:8}9 |
a ^ b |
- {2:~ }|*5
- {3:-- (insert) --} |
+ {1:~ }|*5
+ {5:-- (insert) --} |
]])
feed('i')
screen:expect([[
- 1{1:2}3456789 |
+ 1{21:2}3456789 |
a^ b |
- {2:~ }|*5
- {3:-- INSERT --} |
+ {1:~ }|*5
+ {5:-- INSERT --} |
]])
end)
@@ -1434,11 +1323,11 @@ describe('CursorColumn highlight', function()
]])
screen:expect({
grid = [[
- aaaa{1:a} |
- bbbb{1:b} |
- cccc{1:c} |
+ aaaa{21:a} |
+ bbbb{21:b} |
+ cccc{21:c} |
dddd^d |
- {2:~ }|*3
+ {1:~ }|*3
|
]],
timeout = 100,
@@ -1446,14 +1335,55 @@ describe('CursorColumn highlight', function()
screen:expect({
grid = [[
^aaaaa |
- {1:b}bbbb |
- {1:c}cccc |
- {1:d}dddd |
- {2:~ }|*3
+ {21:b}bbbb |
+ {21:c}cccc |
+ {21:d}dddd |
+ {1:~ }|*3
|
]],
})
end)
+
+ it('is not shown on current line with virtualedit', function()
+ exec([[
+ hi! CursorColumn guibg=Red
+ hi! CursorLine guibg=Blue
+ set virtualedit=all cursorline cursorcolumn
+ ]])
+ insert('line 1\nline 2\nline 3')
+ feed('k')
+ screen:expect([[
+ line {30:1} |
+ {100:line ^2 }|
+ line {30:3} |
+ {1:~ }|*4
+ |
+ ]])
+ feed('l')
+ screen:expect([[
+ line 1{30: } |
+ {100:line 2^ }|
+ line 3{30: } |
+ {1:~ }|*4
+ |
+ ]])
+ feed('l')
+ screen:expect([[
+ line 1 {30: } |
+ {100:line 2 ^ }|
+ line 3 {30: } |
+ {1:~ }|*4
+ |
+ ]])
+ feed('l')
+ screen:expect([[
+ line 1 {30: } |
+ {100:line 2 ^ }|
+ line 3 {30: } |
+ {1:~ }|*4
+ |
+ ]])
+ end)
end)
describe('ColorColumn highlight', function()
@@ -1462,17 +1392,11 @@ describe('ColorColumn highlight', function()
before_each(function()
clear()
screen = Screen.new(40, 15)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.LightRed }, -- ColorColumn
- [2] = { background = Screen.colors.Grey90 }, -- CursorLine
- [3] = { foreground = Screen.colors.Brown }, -- LineNr
- [4] = { foreground = Screen.colors.Brown, bold = true }, -- CursorLineNr
- [5] = { foreground = Screen.colors.Blue, bold = true }, -- NonText
- [6] = { foreground = Screen.colors.Blue, background = Screen.colors.LightRed, bold = true },
- [7] = { reverse = true, bold = true }, -- StatusLine
- [8] = { reverse = true }, -- StatusLineNC
- [9] = { background = Screen.colors.Grey90, foreground = Screen.colors.Red },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
+ [101] = { background = Screen.colors.LightRed },
+ [102] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.LightRed },
+ }
screen:attach()
end)
@@ -1490,16 +1414,16 @@ describe('ColorColumn highlight', function()
buf X
]])
screen:expect([[
- {4: 1 }11{1:1}11111{1:1}1 |
- {3: 2 }22{1:2}22222{1:2}22 |
- {3: 3 }33{1:3}33333{1:3}3 |
- {5:~ }|*3
- {8:X }|
- {4: 1 }^11{1:1}11111{1:1}1 |
- {3: 2 }22{1:2}22222{1:2}22 |
- {3: 3 }33{1:3}33333{1:3}3 |
- {5:~ }|*3
- {7:X }|
+ {15: 1 }11{101:1}11111{101:1}1 |
+ {8: 2 }22{101:2}22222{101:2}22 |
+ {8: 3 }33{101:3}33333{101:3}3 |
+ {1:~ }|*3
+ {2:X }|
+ {15: 1 }^11{101:1}11111{101:1}1 |
+ {8: 2 }22{101:2}22222{101:2}22 |
+ {8: 3 }33{101:3}33333{101:3}3 |
+ {1:~ }|*3
+ {3:X }|
|
]])
end)
@@ -1511,9 +1435,9 @@ describe('ColorColumn highlight', function()
set co=40 linebreak bri briopt=shift:2 cc=40,41,43
]])
screen:expect([[
- ^The quick brown fox jumped over the {1: }|
- {1: } {1:l}azy dogs |
- {5:~ }|*12
+ ^The quick brown fox jumped over the {101: }|
+ {101: } {101:l}azy dogs |
+ {1:~ }|*12
|
]])
end)
@@ -1525,9 +1449,9 @@ describe('ColorColumn highlight', function()
set co=40 showbreak=+++>\\ cc=40,41,43
]])
screen:expect([[
- ^The quick brown fox jumped over the laz{1:y}|
- {6:+}{5:+}{6:+}{5:>\} dogs |
- {5:~ }|*12
+ ^The quick brown fox jumped over the laz{101:y}|
+ {102:+}{1:+}{102:+}{1:>\} dogs |
+ {1:~ }|*12
|
]])
end)
@@ -1536,17 +1460,17 @@ describe('ColorColumn highlight', function()
screen:try_resize(40, 2)
command('set colorcolumn=30 cursorline')
screen:expect([[
- {2:^ }{1: }{2: }|
+ {21:^ }{101: }{21: }|
|
]])
command('hi clear ColorColumn')
screen:expect([[
- {2:^ }|
+ {21:^ }|
|
]])
command('hi ColorColumn guifg=Red')
screen:expect([[
- {2:^ }{9: }{2: }|
+ {21:^ }{100: }{21: }|
|
]])
end)
@@ -2274,7 +2198,7 @@ describe("'winhighlight' highlight", function()
]],
}
- helpers.assert_alive()
+ n.assert_alive()
end)
it('can redraw statusline on cursor movement', function()
@@ -2494,3 +2418,115 @@ describe('highlight namespaces', function()
}
end)
end)
+
+describe('synIDattr()', function()
+ local screen
+ before_each(function()
+ clear()
+ screen = Screen.new(50, 7)
+ command('highlight Normal ctermfg=252 guifg=#ff0000 guibg=Black')
+ -- Salmon #fa8072 Maroon #800000
+ command(
+ 'highlight Keyword ctermfg=79 guifg=Salmon guisp=Maroon cterm=strikethrough gui=strikethrough'
+ )
+ end)
+
+ it('returns cterm-color if RGB-capable UI is _not_ attached', function()
+ eq('252', eval('synIDattr(hlID("Normal"), "fg")'))
+ eq('252', eval('synIDattr(hlID("Normal"), "fg#")'))
+ eq('', eval('synIDattr(hlID("Normal"), "bg")'))
+ eq('', eval('synIDattr(hlID("Normal"), "bg#")'))
+ eq('79', eval('synIDattr(hlID("Keyword"), "fg")'))
+ eq('79', eval('synIDattr(hlID("Keyword"), "fg#")'))
+ eq('', eval('synIDattr(hlID("Keyword"), "sp")'))
+ eq('', eval('synIDattr(hlID("Keyword"), "sp#")'))
+ end)
+
+ it('returns gui-color if "gui" arg is passed', function()
+ eq('Black', eval('synIDattr(hlID("Normal"), "bg", "gui")'))
+ eq('Maroon', eval('synIDattr(hlID("Keyword"), "sp", "gui")'))
+ end)
+
+ it('returns gui-color if RGB-capable UI is attached', function()
+ screen:attach({ rgb = true })
+ eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg")'))
+ eq('Black', eval('synIDattr(hlID("Normal"), "bg")'))
+ eq('Salmon', eval('synIDattr(hlID("Keyword"), "fg")'))
+ eq('Maroon', eval('synIDattr(hlID("Keyword"), "sp")'))
+ end)
+
+ it('returns #RRGGBB value for fg#/bg#/sp#', function()
+ screen:attach({ rgb = true })
+ eq('#ff0000', eval('synIDattr(hlID("Normal"), "fg#")'))
+ eq('#000000', eval('synIDattr(hlID("Normal"), "bg#")'))
+ eq('#fa8072', eval('synIDattr(hlID("Keyword"), "fg#")'))
+ eq('#800000', eval('synIDattr(hlID("Keyword"), "sp#")'))
+ end)
+
+ it('returns color number if non-GUI', function()
+ screen:attach({ rgb = false })
+ eq('252', eval('synIDattr(hlID("Normal"), "fg")'))
+ eq('79', eval('synIDattr(hlID("Keyword"), "fg")'))
+ end)
+
+ it('returns "1" if group has given highlight attribute', function()
+ local hl_attrs = {
+ 'underline',
+ 'undercurl',
+ 'underdouble',
+ 'underdotted',
+ 'underdashed',
+ 'strikethrough',
+ }
+ for _, hl_attr in ipairs(hl_attrs) do
+ local context = 'using ' .. hl_attr .. ' attr'
+ command('highlight Keyword cterm=' .. hl_attr .. ' gui=' .. hl_attr)
+ eq('', eval('synIDattr(hlID("Normal"), "' .. hl_attr .. '")'), context)
+ eq('1', eval('synIDattr(hlID("Keyword"), "' .. hl_attr .. '")'), context)
+ eq('1', eval('synIDattr(hlID("Keyword"), "' .. hl_attr .. '", "gui")'), context)
+ end
+ end)
+end)
+
+describe('fg/bg special colors', function()
+ local screen
+ before_each(function()
+ clear()
+ screen = Screen.new(50, 7)
+ command('highlight Normal ctermfg=145 ctermbg=16 guifg=#ff0000 guibg=Black')
+ command('highlight Visual ctermfg=bg ctermbg=fg guifg=bg guibg=fg guisp=bg')
+ end)
+
+ it('resolve to "Normal" values', function()
+ eq(eval('synIDattr(hlID("Normal"), "bg")'), eval('synIDattr(hlID("Visual"), "fg")'))
+ eq(eval('synIDattr(hlID("Normal"), "bg#")'), eval('synIDattr(hlID("Visual"), "fg#")'))
+ eq(eval('synIDattr(hlID("Normal"), "fg")'), eval('synIDattr(hlID("Visual"), "bg")'))
+ eq(eval('synIDattr(hlID("Normal"), "fg#")'), eval('synIDattr(hlID("Visual"), "bg#")'))
+ eq('bg', eval('synIDattr(hlID("Visual"), "fg", "gui")'))
+ eq('bg', eval('synIDattr(hlID("Visual"), "fg#", "gui")'))
+ eq('fg', eval('synIDattr(hlID("Visual"), "bg", "gui")'))
+ eq('fg', eval('synIDattr(hlID("Visual"), "bg#", "gui")'))
+ eq('bg', eval('synIDattr(hlID("Visual"), "sp", "gui")'))
+ eq('bg', eval('synIDattr(hlID("Visual"), "sp#", "gui")'))
+ end)
+
+ it('resolve to "Normal" values in RGB-capable UI', function()
+ screen:attach({ rgb = true })
+ eq('bg', eval('synIDattr(hlID("Visual"), "fg")'))
+ eq(eval('synIDattr(hlID("Normal"), "bg#")'), eval('synIDattr(hlID("Visual"), "fg#")'))
+ eq('fg', eval('synIDattr(hlID("Visual"), "bg")'))
+ eq(eval('synIDattr(hlID("Normal"), "fg#")'), eval('synIDattr(hlID("Visual"), "bg#")'))
+ eq('bg', eval('synIDattr(hlID("Visual"), "sp")'))
+ eq(eval('synIDattr(hlID("Normal"), "bg#")'), eval('synIDattr(hlID("Visual"), "sp#")'))
+ end)
+
+ it('resolve after the "Normal" group is modified', function()
+ screen:attach({ rgb = true })
+ local new_guibg = '#282c34'
+ local new_guifg = '#abb2bf'
+ command('highlight Normal guifg=' .. new_guifg .. ' guibg=' .. new_guibg)
+ eq(new_guibg, eval('synIDattr(hlID("Visual"), "fg#")'))
+ eq(new_guifg, eval('synIDattr(hlID("Visual"), "bg#")'))
+ eq(new_guibg, eval('synIDattr(hlID("Visual"), "sp#")'))
+ end)
+end)
diff --git a/test/functional/ui/hlstate_spec.lua b/test/functional/ui/hlstate_spec.lua
index 8b36ad5431..8d14c9f73d 100644
--- a/test/functional/ui/hlstate_spec.lua
+++ b/test/functional/ui/hlstate_spec.lua
@@ -1,13 +1,14 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
+local tt = require('test.functional.terminal.testutil')
-local clear, insert = helpers.clear, helpers.insert
-local command = helpers.command
-local api = helpers.api
-local testprg = helpers.testprg
-local thelpers = require('test.functional.terminal.helpers')
-local skip = helpers.skip
-local is_os = helpers.is_os
+local clear, insert = n.clear, n.insert
+local command = n.command
+local api = n.api
+local testprg = n.testprg
+local skip = t.skip
+local is_os = t.is_os
describe('ext_hlstate detailed highlights', function()
local screen
@@ -236,11 +237,11 @@ describe('ext_hlstate detailed highlights', function()
{7: }|
]])
- thelpers.feed_data('x ')
- thelpers.set_fg(45)
- thelpers.feed_data('y ')
- thelpers.set_bold()
- thelpers.feed_data('z\n')
+ tt.feed_data('x ')
+ tt.set_fg(45)
+ tt.feed_data('y ')
+ tt.set_bold()
+ tt.feed_data('z\n')
-- TODO(bfredl): check if this distinction makes sense
if is_os('win') then
screen:expect([[
@@ -260,8 +261,8 @@ describe('ext_hlstate detailed highlights', function()
]])
end
- thelpers.feed_termcode('[A')
- thelpers.feed_termcode('[2C')
+ tt.feed_termcode('[A')
+ tt.feed_termcode('[2C')
if is_os('win') then
screen:expect([[
^tty ready |
@@ -381,7 +382,7 @@ describe('ext_hlstate detailed highlights', function()
},
}
- helpers.feed('3ggV2jd')
+ n.feed('3ggV2jd')
--screen:redraw_debug()
screen:expect {
grid = [[
@@ -478,7 +479,7 @@ describe('ext_hlstate detailed highlights', function()
},
}
- helpers.feed('3ggV2jd')
+ n.feed('3ggV2jd')
--screen:redraw_debug()
screen:expect {
grid = [[
@@ -512,7 +513,7 @@ describe('ext_hlstate detailed highlights', function()
end
insert('last line')
- helpers.feed('gg')
+ n.feed('gg')
screen:expect {
grid = [[
^first line |
@@ -555,7 +556,7 @@ describe('ext_hlstate detailed highlights', function()
},
}
- helpers.feed(string.format('3ggV%ijd', num_lines - 2))
+ n.feed(string.format('3ggV%ijd', num_lines - 2))
--screen:redraw_debug(nil, nil, 100000)
local expected_ids = {}
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index 29c8c43ca1..c11e009fef 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -1,22 +1,24 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local eq = helpers.eq
-local eval = helpers.eval
-local expect = helpers.expect
-local feed = helpers.feed
-local insert = helpers.insert
-local fn = helpers.fn
-local api = helpers.api
-local neq = helpers.neq
-local ok = helpers.ok
-local retry = helpers.retry
-local source = helpers.source
-local poke_eventloop = helpers.poke_eventloop
+
+local clear = n.clear
+local command = n.command
+local eq = t.eq
+local eval = n.eval
+local expect = n.expect
+local feed = n.feed
+local insert = n.insert
+local fn = n.fn
+local api = n.api
+local neq = t.neq
+local ok = t.ok
+local retry = t.retry
+local source = n.source
+local poke_eventloop = n.poke_eventloop
local sleep = vim.uv.sleep
-local testprg = helpers.testprg
-local assert_alive = helpers.assert_alive
+local testprg = n.testprg
+local assert_alive = n.assert_alive
local default_text = [[
Inc substitution on
@@ -65,26 +67,12 @@ local function common_setup(screen, inccommand, text)
command('set nohlsearch')
command('hi Substitute guifg=red guibg=yellow')
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Fuchsia },
- [2] = { foreground = Screen.colors.Brown, bold = true },
- [3] = { foreground = Screen.colors.SlateBlue },
- [4] = { bold = true, foreground = Screen.colors.SlateBlue },
- [5] = { foreground = Screen.colors.DarkCyan },
- [6] = { bold = true },
- [7] = { underline = true, bold = true, foreground = Screen.colors.SlateBlue },
- [8] = { foreground = Screen.colors.Slateblue, underline = true },
- [9] = { background = Screen.colors.Yellow },
- [10] = { reverse = true },
- [11] = { reverse = true, bold = true },
- [12] = { foreground = Screen.colors.Red, background = Screen.colors.Yellow },
- [13] = { bold = true, foreground = Screen.colors.SeaGreen },
- [14] = { foreground = Screen.colors.White, background = Screen.colors.Red },
- [15] = { bold = true, foreground = Screen.colors.Blue },
- [16] = { background = Screen.colors.Grey90 }, -- cursorline
- [17] = { foreground = Screen.colors.Blue1 },
+
+ screen:add_extra_attr_ids {
+ [100] = { underline = true },
+ [101] = { underline = true, foreground = Screen.colors.SlateBlue, bold = true },
vis = { background = Screen.colors.LightGrey },
- })
+ }
end
command('set inccommand=' .. (inccommand or ''))
@@ -142,13 +130,13 @@ describe(":substitute, 'inccommand' preserves", function()
screen:expect([[
BAC |
- {15:~ }|*3
- {11: }|
+ {1:~ }|*3
+ {3: }|
:ls |
1 %a + "[No Name]" |
line 1 |
- {13:Press ENTER or type command to}|
- {13: continue}^ |
+ {6:Press ENTER or type command to}|
+ {6: continue}^ |
]])
end)
@@ -204,8 +192,8 @@ describe(":substitute, 'inccommand' preserves", function()
feed(':%s/as/glork/')
poke_eventloop()
feed('<enter>')
- eq(api.nvim_get_option_value('undolevels', { scope = 'global' }), 139)
- eq(api.nvim_get_option_value('undolevels', { buf = 0 }), 34)
+ eq(139, api.nvim_get_option_value('undolevels', { scope = 'global' }))
+ eq(34, api.nvim_get_option_value('undolevels', { buf = 0 }))
end)
end
@@ -577,7 +565,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
two lines |
^ |
- {15:~ }|*6
+ {1:~ }|*6
|
]])
command('set undolevels=1')
@@ -613,7 +601,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
else
@@ -621,7 +609,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
end
@@ -655,7 +643,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
two line^s |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
else
@@ -663,7 +651,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
two line^s |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
end
@@ -693,7 +681,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
else
@@ -701,7 +689,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
end
@@ -725,7 +713,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
else
@@ -733,7 +721,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
end
@@ -754,7 +742,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
^LInc substitution on|
two lines |
|
- {15:~ }|*6
+ {1:~ }|*6
Already ...t change |
]])
end
@@ -775,15 +763,15 @@ describe(':substitute, inccommand=split', function()
feed(':%s/tw')
screen:expect([[
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
|
- {11:[No Name] }|
- |2| {12:tw}o lines |
- |4| {12:tw}o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] }|
+ |2| {20:tw}o lines |
+ |4| {20:tw}o lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/tw^ |
]])
feed([[<C-\><C-N>]]) -- Cancel the :substitute command.
@@ -793,13 +781,13 @@ describe(':substitute, inccommand=split', function()
it('shows preview when cmd modifiers are present', function()
-- one modifier
feed(':keeppatterns %s/tw/to')
- screen:expect { any = [[{12:to}o lines]] }
+ screen:expect { any = [[{20:to}o lines]] }
feed('<Esc>')
screen:expect { any = [[two lines]] }
-- multiple modifiers
feed(':keeppatterns silent %s/tw/to')
- screen:expect { any = [[{12:to}o lines]] }
+ screen:expect { any = [[{20:to}o lines]] }
feed('<Esc>')
screen:expect { any = [[two lines]] }
@@ -811,14 +799,14 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
two lines |
|
- {15:~ }|*9
+ {1:~ }|*9
:silent tabedit %s/tw/to^ |
]])
feed('<Esc>')
-- leading colons
feed(':::%s/tw/to')
- screen:expect { any = [[{12:to}o lines]] }
+ screen:expect { any = [[{20:to}o lines]] }
feed('<Esc>')
screen:expect { any = [[two lines]] }
end)
@@ -828,15 +816,15 @@ describe(':substitute, inccommand=split', function()
feed(':topleft %s/tw/to')
screen:expect([[
Inc substitution on |
- {12:to}o lines |
+ {20:to}o lines |
Inc substitution on |
- {12:to}o lines |
+ {20:to}o lines |
|
- {11:[No Name] [+] }|
- |2| {12:to}o lines |
- |4| {12:to}o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |2| {20:to}o lines |
+ |4| {20:to}o lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:topleft %s/tw/to^ |
]])
feed('<Esc>')
@@ -846,15 +834,15 @@ describe(':substitute, inccommand=split', function()
feed(':topleft vert %s/tw/to')
screen:expect([[
Inc substitution on |
- {12:to}o lines |
+ {20:to}o lines |
Inc substitution on |
- {12:to}o lines |
+ {20:to}o lines |
|
- {11:[No Name] [+] }|
- |2| {12:to}o lines |
- |4| {12:to}o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |2| {20:to}o lines |
+ |4| {20:to}o lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:topleft vert %s/tw/to^ |
]])
feed('<Esc>')
@@ -865,15 +853,15 @@ describe(':substitute, inccommand=split', function()
feed(':%s/tw')
screen:expect([[
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
|
- {11:[No Name] [+] }|
- |2| {12:tw}o lines |
- |4| {12:tw}o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |2| {20:tw}o lines |
+ |4| {20:tw}o lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/tw^ |
]])
end)
@@ -886,26 +874,26 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
o lines |
|
- {11:[No Name] [+] }|
+ {3:[No Name] [+] }|
|2| o lines |
|4| o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/tw/^ |
]])
feed('x')
screen:expect([[
Inc substitution on |
- {12:x}o lines |
+ {20:x}o lines |
Inc substitution on |
- {12:x}o lines |
+ {20:x}o lines |
|
- {11:[No Name] [+] }|
- |2| {12:x}o lines |
- |4| {12:x}o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |2| {20:x}o lines |
+ |4| {20:x}o lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/tw/x^ |
]])
@@ -916,11 +904,11 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
o lines |
|
- {11:[No Name] [+] }|
+ {3:[No Name] [+] }|
|2| o lines |
|4| o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/tw/^ |
]])
end)
@@ -929,15 +917,15 @@ describe(':substitute, inccommand=split', function()
feed(':%s/tw/XX')
screen:expect([[
Inc substitution on |
- {12:XX}o lines |
+ {20:XX}o lines |
Inc substitution on |
- {12:XX}o lines |
+ {20:XX}o lines |
|
- {11:[No Name] [+] }|
- |2| {12:XX}o lines |
- |4| {12:XX}o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |2| {20:XX}o lines |
+ |4| {20:XX}o lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/tw/XX^ |
]])
end)
@@ -947,11 +935,11 @@ describe(':substitute, inccommand=split', function()
feed(':s/tw')
screen:expect([[
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
Inc substitution on |
two lines |
|
- {15:~ }|*9
+ {1:~ }|*9
:s/tw^ |
]])
end)
@@ -962,12 +950,12 @@ describe(':substitute, inccommand=split', function()
-- Assert that 'cursorline' is active.
screen:expect([[
- {16:^Inc substitution on }|
+ {21:^Inc substitution on }|
two lines |
Inc substitution on |
two lines |
|
- {15:~ }|*9
+ {1:~ }|*9
|
]])
@@ -975,15 +963,15 @@ describe(':substitute, inccommand=split', function()
-- 'cursorline' is NOT active during preview.
screen:expect([[
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
|
- {11:[No Name] [+] }|
- |2| {12:tw}o lines |
- |4| {12:tw}o lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |2| {20:tw}o lines |
+ |4| {20:tw}o lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/tw^ |
]])
end)
@@ -993,15 +981,15 @@ describe(':substitute, inccommand=split', function()
feed('M M M<esc>')
feed(':%s/M/123/g')
screen:expect([[
- {12:123} {12:123} {12:123} |
+ {20:123} {20:123} {20:123} |
Inc substitution on |
two lines |
Inc substitution on |
two lines |
- {11:[No Name] [+] }|
- |1| {12:123} {12:123} {12:123} |
- {15:~ }|*6
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| {20:123} {20:123} {20:123} |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/M/123/g^ |
]])
end)
@@ -1015,10 +1003,10 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
two lines |
|
- {11:[No Name] [+] }|
+ {3:[No Name] [+] }|
|
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/Inx^ |
]])
end)
@@ -1030,12 +1018,12 @@ describe(':substitute, inccommand=split', function()
insert(string.rep('abc abc abc\n', 20))
feed(':%s/abc/MMM/g')
screen:expect([[
- {12:MMM} {12:MMM} {12:MMM} |*9
- {11:[No Name] [+] }|
- | 1| {12:MMM} {12:MMM} {12:MMM} |
- | 2| {12:MMM} {12:MMM} {12:MMM} |
- | 3| {12:MMM} {12:MMM} {12:MMM} |
- {10:[Preview] }|
+ {20:MMM} {20:MMM} {20:MMM} |*9
+ {3:[No Name] [+] }|
+ | 1| {20:MMM} {20:MMM} {20:MMM} |
+ | 2| {20:MMM} {20:MMM} {20:MMM} |
+ | 3| {20:MMM} {20:MMM} {20:MMM} |
+ {2:[Preview] }|
:%s/abc/MMM/g^ |
]])
end)
@@ -1051,7 +1039,7 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
^XXo lines |
|
- {15:~ }|*9
+ {1:~ }|*9
:%s/tw/XX/g |
]])
end)
@@ -1067,17 +1055,17 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
BBo lines |
Inc substitution on |
- {12:X}o lines |
+ {20:X}o lines |
Inc substitution on |
- {11:[No Name] [+] }|
- |1001| {12:X}o lines |
- |1003| {12:X}o lines |
- |1005| {12:X}o lines |
- |1007| {12:X}o lines |
- |1009| {12:X}o lines |
- |1011| {12:X}o lines |
- |1013| {12:X}o lines |
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1001| {20:X}o lines |
+ |1003| {20:X}o lines |
+ |1005| {20:X}o lines |
+ |1007| {20:X}o lines |
+ |1009| {20:X}o lines |
+ |1011| {20:X}o lines |
+ |1013| {20:X}o lines |
+ {2:[Preview] }|
:%s/tw/X^ |
]])
end)
@@ -1111,7 +1099,7 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
two lines |
^ |
- {15:~ }|*9
+ {1:~ }|*9
2 matches on 2 lines |
]])
end)
@@ -1196,16 +1184,16 @@ describe(':substitute, inccommand=split', function()
feed(':1,2s/t/X')
screen:expect([[
- Inc subs{12:X}itution on |
- {12:X}wo lines |
+ Inc subs{20:X}itution on |
+ {20:X}wo lines |
Inc substitution on |
two lines |
|
- {11:[No Name] [+] }|
- |1| Inc subs{12:X}itution on |
- |2| {12:X}wo lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| Inc subs{20:X}itution on |
+ |2| {20:X}wo lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:1,2s/t/X^ |
]])
@@ -1218,7 +1206,7 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
two lines |
|
- {15:~ }|*9
+ {1:~ }|*9
:echo 'foo'^ |
]])
end)
@@ -1227,65 +1215,65 @@ describe(':substitute, inccommand=split', function()
feed('gg')
feed(':1,2s/t/X')
screen:expect([[
- Inc subs{12:X}itution on |
- {12:X}wo lines |
+ Inc subs{20:X}itution on |
+ {20:X}wo lines |
Inc substitution on |
two lines |
|
- {11:[No Name] [+] }|
- |1| Inc subs{12:X}itution on |
- |2| {12:X}wo lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| Inc subs{20:X}itution on |
+ |2| {20:X}wo lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:1,2s/t/X^ |
]])
feed([[<C-R>='Y']])
-- preview should be unchanged during c_CTRL-R_= editing
screen:expect([[
- Inc subs{12:X}itution on |
- {12:X}wo lines |
+ Inc subs{20:X}itution on |
+ {20:X}wo lines |
Inc substitution on |
two lines |
|
- {11:[No Name] [+] }|
- |1| Inc subs{12:X}itution on |
- |2| {12:X}wo lines |
- {15:~ }|*5
- {10:[Preview] }|
- ={1:'Y'}^ |
+ {3:[No Name] [+] }|
+ |1| Inc subs{20:X}itution on |
+ |2| {20:X}wo lines |
+ {1:~ }|*5
+ {2:[Preview] }|
+ ={26:'Y'}^ |
]])
feed('<CR>')
-- preview should be changed by the result of the expression
screen:expect([[
- Inc subs{12:XY}itution on |
- {12:XY}wo lines |
+ Inc subs{20:XY}itution on |
+ {20:XY}wo lines |
Inc substitution on |
two lines |
|
- {11:[No Name] [+] }|
- |1| Inc subs{12:XY}itution on |
- |2| {12:XY}wo lines |
- {15:~ }|*5
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| Inc subs{20:XY}itution on |
+ |2| {20:XY}wo lines |
+ {1:~ }|*5
+ {2:[Preview] }|
:1,2s/t/XY^ |
]])
feed([[<C-\>e'echo']])
-- preview should be unchanged during c_CTRL-\_e editing
screen:expect([[
- Inc subs{12:XY}itution on |
- {12:XY}wo lines |
+ Inc subs{20:XY}itution on |
+ {20:XY}wo lines |
Inc substitution on |
two lines |
|
- {11:[No Name] [+] }|
- |1| Inc subs{12:XY}itution on |
- |2| {12:XY}wo lines |
- {15:~ }|*5
- {10:[Preview] }|
- ={1:'echo'}^ |
+ {3:[No Name] [+] }|
+ |1| Inc subs{20:XY}itution on |
+ |2| {20:XY}wo lines |
+ {1:~ }|*5
+ {2:[Preview] }|
+ ={26:'echo'}^ |
]])
feed('<CR>')
@@ -1296,7 +1284,7 @@ describe(':substitute, inccommand=split', function()
Inc substitution on |
two lines |
|
- {15:~ }|*9
+ {1:~ }|*9
:echo^ |
]])
end)
@@ -1321,8 +1309,8 @@ describe('inccommand=nosplit', function()
two lines |
Inc substitution on |
two lines |
- Line *.{12:X} |
- {15:~ }|*4
+ Line *.{20:X} |
+ {1:~ }|*4
:%smagic/3.*/X^ |
]])
@@ -1333,8 +1321,8 @@ describe('inccommand=nosplit', function()
two lines |
Inc substitution on |
two lines |
- Line *.{12:X} here |
- {15:~ }|*4
+ Line *.{20:X} here |
+ {1:~ }|*4
:%snomagic/3.*/X^ |
]])
end)
@@ -1342,13 +1330,13 @@ describe('inccommand=nosplit', function()
it('shows preview when cmd modifiers are present', function()
-- one modifier
feed(':keeppatterns %s/tw/to')
- screen:expect { any = [[{12:to}o lines]] }
+ screen:expect { any = [[{20:to}o lines]] }
feed('<Esc>')
screen:expect { any = [[two lines]] }
-- multiple modifiers
feed(':keeppatterns silent %s/tw/to')
- screen:expect { any = [[{12:to}o lines]] }
+ screen:expect { any = [[{20:to}o lines]] }
feed('<Esc>')
screen:expect { any = [[two lines]] }
@@ -1360,8 +1348,8 @@ describe('inccommand=nosplit', function()
Inc substitution on |
two lines |
|
- {15:~ }|*2
- {11: }|
+ {1:~ }|*2
+ {3: }|
:silent tabedit %s/t|
w/to^ |
]])
@@ -1378,11 +1366,11 @@ describe('inccommand=nosplit', function()
poke_eventloop()
screen:expect([[
Inc substitution on |
- {12:OKOK}o lines |
+ {20:OKOK}o lines |
Inc substitution on |
- {12:OKOK}o lines |
+ {20:OKOK}o lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:%s/tw/OKOK^ |
]])
end)
@@ -1393,33 +1381,33 @@ describe('inccommand=nosplit', function()
feed(':%s/tw')
screen:expect([[
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:%s/tw^ |
]])
feed('/BM')
screen:expect([[
Inc substitution on |
- {12:BM}o lines |
+ {20:BM}o lines |
Inc substitution on |
- {12:BM}o lines |
+ {20:BM}o lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:%s/tw/BM^ |
]])
feed('/')
screen:expect([[
Inc substitution on |
- {12:BM}o lines |
+ {20:BM}o lines |
Inc substitution on |
- {12:BM}o lines |
+ {20:BM}o lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:%s/tw/BM/^ |
]])
@@ -1430,7 +1418,7 @@ describe('inccommand=nosplit', function()
Inc substitution on |
^BMo lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:%s/tw/BM/ |
]])
end)
@@ -1442,12 +1430,12 @@ describe('inccommand=nosplit', function()
feed(':1,2s/t/X')
screen:expect([[
- Inc subs{12:X}itution on |
- {12:X}wo lines |
+ Inc subs{20:X}itution on |
+ {20:X}wo lines |
Inc substitution on |
two lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:1,2s/t/X^ |
]])
@@ -1460,7 +1448,7 @@ describe('inccommand=nosplit', function()
Inc substitution on |
two lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:echo 'foo'^ |
]])
end)
@@ -1469,11 +1457,11 @@ describe('inccommand=nosplit', function()
feed(':%s/two/three/g|q!')
screen:expect([[
Inc substitution on |
- {12:three} lines |
+ {20:three} lines |
Inc substitution on |
- {12:three} lines |
+ {20:three} lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:%s/two/three/g|q!^ |
]])
eq(eval('v:null'), eval('v:exiting'))
@@ -1494,7 +1482,7 @@ describe('inccommand=nosplit', function()
Inc substitution on |
two lines |
|
- {15:~ }|*4
+ {1:~ }|*4
:%s/^ |
]])
end)
@@ -1546,7 +1534,7 @@ describe(":substitute, 'inccommand' with a failing expression", function()
Inc substitution on |
two lines |
|
- {15:~ }|*6
+ {1:~ }|*6
:100s/^ |
]])
@@ -1555,8 +1543,8 @@ describe(":substitute, 'inccommand' with a failing expression", function()
Inc substitution on |
two lines |
^ |
- {15:~ }|*6
- {14:E16: Invalid range} |
+ {1:~ }|*6
+ {9:E16: Invalid range} |
]])
end
end)
@@ -1649,7 +1637,7 @@ describe("'inccommand' and :cnoremap", function()
command("cnoremap <expr> x execute('bwipeout!')[-1].'x'")
feed(':%s/tw/tox<enter>')
- screen:expect { any = [[{14:^E565:]] }
+ screen:expect { any = [[{9:^E565:]] }
feed('<c-c>')
-- error thrown b/c of the mapping
@@ -1736,9 +1724,9 @@ describe("'inccommand' autocommands", function()
CmdwinLeave = {},
}
- local function bufferlist(t)
+ local function bufferlist(q)
local s = ''
- for _, buffer in pairs(t) do
+ for _, buffer in pairs(q) do
s = s .. ', ' .. tostring(buffer)
end
return s
@@ -1807,18 +1795,18 @@ describe("'inccommand' split windows", function()
feed(':%s/tw')
screen:expect([[
Inc substitution on │Inc substitution on|
- {12:tw}o lines │{12:tw}o lines |
+ {20:tw}o lines │{20:tw}o lines |
│ |
- {15:~ }│{15:~ }|*11
- {11:[No Name] [+] }│{15:~ }|
- Inc substitution on │{15:~ }|
- {12:tw}o lines │{15:~ }|
- │{15:~ }|
- {15:~ }│{15:~ }|*2
- {10:[No Name] [+] [No Name] [+] }|
- |2| {12:tw}o lines |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }│{1:~ }|
+ Inc substitution on │{1:~ }|
+ {20:tw}o lines │{1:~ }|
+ │{1:~ }|
+ {1:~ }│{1:~ }|*2
+ {2:[No Name] [+] [No Name] [+] }|
+ |2| {20:tw}o lines |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/tw^ |
]])
@@ -1830,18 +1818,18 @@ describe("'inccommand' split windows", function()
feed(':%s/tw')
screen:expect([[
Inc substitution on │Inc substitution on|
- {12:tw}o lines │{12:tw}o lines |
+ {20:tw}o lines │{20:tw}o lines |
│ |
- {15:~ }│{15:~ }|*11
- {11:[No Name] [+] }{10:[No Name] [+] }|
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
|
- {15:~ }|*2
- {10:[No Name] [+] }|
- |2| {12:tw}o lines |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|*2
+ {2:[No Name] [+] }|
+ |2| {20:tw}o lines |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/tw^ |
]])
end)
@@ -1864,13 +1852,13 @@ describe("'inccommand' split windows", function()
screen:expect([[
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
|
- {15:~ }|*17
- {11:[No Name] [+] }|
- |2| {12:tw}o lines |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|*17
+ {3:[No Name] [+] }|
+ |2| {20:tw}o lines |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/tw^ |
]])
end
@@ -1882,7 +1870,7 @@ describe("'inccommand' split windows", function()
feed('gg:%s/tw')
screen:expect([[
Inc substitution on |
- {12:tw}o lines |
+ {20:tw}o lines |
:%s/tw^ |
]])
end)
@@ -1931,10 +1919,10 @@ describe("'inccommand' with 'gdefault'", function()
feed(':%s/\\%1c/a/')
screen:expect([[
- {12:a}Inc substitution on |
- {12:a}two lines |
- {12:a} |
- {15:~ }|
+ {20:a}Inc substitution on |
+ {20:a}two lines |
+ {20:a} |
+ {1:~ }|
:%s/\%1c/a/^ |
]])
@@ -1943,7 +1931,7 @@ describe("'inccommand' with 'gdefault'", function()
Inc substitution on |
two lines |
^ |
- {15:~ }|
+ {1:~ }|
|
]])
end)
@@ -1962,47 +1950,47 @@ describe(':substitute', function()
feed(':%s/2\\_.*X')
screen:expect([[
- 1 {12:2 3} |
- {12:A B C} |
- {12:4 5 6} |
- {12:X} Y Z |
+ 1 {20:2 3} |
+ {20:A B C} |
+ {20:4 5 6} |
+ {20:X} Y Z |
7 8 9 |
- {11:[No Name] [+] }|
- |1| 1 {12:2 3} |
- |2|{12: A B C} |
- |3|{12: 4 5 6} |
- |4|{12: X} Y Z |
- {15:~ }|*3
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| 1 {20:2 3} |
+ |2|{20: A B C} |
+ |3|{20: 4 5 6} |
+ |4|{20: X} Y Z |
+ {1:~ }|*3
+ {2:[Preview] }|
:%s/2\_.*X^ |
]])
feed('/MMM')
screen:expect([[
- 1 {12:MMM} Y Z |
+ 1 {20:MMM} Y Z |
7 8 9 |
|
- {15:~ }|*2
- {11:[No Name] [+] }|
- |1| 1 {12:MMM} Y Z |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|*2
+ {3:[No Name] [+] }|
+ |1| 1 {20:MMM} Y Z |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/2\_.*X/MMM^ |
]])
feed('\\rK\\rLLL')
screen:expect([[
- 1 {12:MMM} |
- {12:K} |
- {12:LLL} Y Z |
+ 1 {20:MMM} |
+ {20:K} |
+ {20:LLL} Y Z |
7 8 9 |
|
- {11:[No Name] [+] }|
- |1| 1 {12:MMM} |
- |2|{12: K} |
- |3|{12: LLL} Y Z |
- {15:~ }|*4
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| 1 {20:MMM} |
+ |2|{20: K} |
+ |3|{20: LLL} Y Z |
+ {1:~ }|*4
+ {2:[Preview] }|
:%s/2\_.*X/MMM\rK\rLLL^ |
]])
end)
@@ -2013,21 +2001,21 @@ describe(':substitute', function()
feed(':%s/2\\_.*X/MMM')
screen:expect([[
- 1 {12:MMM} Y Z |
+ 1 {20:MMM} Y Z |
7 8 9 |
|
- {15:~ }|*11
+ {1:~ }|*11
:%s/2\_.*X/MMM^ |
]])
feed('\\rK\\rLLL')
screen:expect([[
- 1 {12:MMM} |
- {12:K} |
- {12:LLL} Y Z |
+ 1 {20:MMM} |
+ {20:K} |
+ {20:LLL} Y Z |
7 8 9 |
|
- {15:~ }|*9
+ {1:~ }|*9
:%s/2\_.*X/MMM\rK\rLLL^ |
]])
end)
@@ -2039,15 +2027,15 @@ describe(':substitute', function()
feed(':%s/a/XLK')
screen:expect([[
- {12:XLK} bdc e{12:XLK}e {12:XLK} fgl lzi{12:XLK} r|
+ {20:XLK} bdc e{20:XLK}e {20:XLK} fgl lzi{20:XLK} r|
x |
|
- {15:~ }|*2
- {11:[No Name] [+] }|
- |1| {12:XLK} bdc e{12:XLK}e {12:XLK} fgl lzi{12:X}|
- {12:LK} r |
- {15:~ }|*5
- {10:[Preview] }|
+ {1:~ }|*2
+ {3:[No Name] [+] }|
+ |1| {20:XLK} bdc e{20:XLK}e {20:XLK} fgl lzi{20:X}|
+ {20:LK} r |
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/a/XLK^ |
]])
end)
@@ -2059,10 +2047,10 @@ describe(':substitute', function()
feed(':%s/a/XLK')
screen:expect([[
- {12:XLK} bdc e{12:XLK}e {12:XLK} fgl lzi{12:XLK} r|
+ {20:XLK} bdc e{20:XLK}e {20:XLK} fgl lzi{20:XLK} r|
x |
|
- {15:~ }|*11
+ {1:~ }|*11
:%s/a/XLK^ |
]])
end)
@@ -2073,18 +2061,18 @@ describe(':substitute', function()
feed(':%s/[0-9]\\n\\zs[A-Z]/OKO')
screen:expect([[
- {12:OKO} B C |
+ {20:OKO} B C |
4 5 6 |
- {12:OKO} Y Z |
+ {20:OKO} Y Z |
7 8 9 |
|
- {11:[No Name] [+] }|
+ {3:[No Name] [+] }|
|1| 1 2 3 |
- |2| {12:OKO} B C |
+ |2| {20:OKO} B C |
|3| 4 5 6 |
- |4| {12:OKO} Y Z |
- {15:~ }|*3
- {10:[Preview] }|
+ |4| {20:OKO} Y Z |
+ {1:~ }|*3
+ {2:[Preview] }|
:%s/[0-9]\n\zs[A-Z]/OKO^ |
]])
end)
@@ -2096,12 +2084,12 @@ describe(':substitute', function()
feed(':%s/[0-9]\\n\\zs[A-Z]/OKO')
screen:expect([[
1 2 3 |
- {12:OKO} B C |
+ {20:OKO} B C |
4 5 6 |
- {12:OKO} Y Z |
+ {20:OKO} Y Z |
7 8 9 |
|
- {15:~ }|*8
+ {1:~ }|*8
:%s/[0-9]\n\zs[A-Z]/OKO^ |
]])
end)
@@ -2111,14 +2099,14 @@ describe(':substitute', function()
feed(':%s/T\\([0-9]\\+\\)/\\1\\1/g')
screen:expect([[
- T {12:123123} {12:22}T TTT {12:090804090804} |
+ T {20:123123} {20:22}T TTT {20:090804090804} |
x |
- {15:~ }|*3
- {11:[No Name] [+] }|
- |1| T {12:123123} {12:22}T TTT {12:090804090}|
- {12:804} |
- {15:~ }|*5
- {10:[Preview] }|
+ {1:~ }|*3
+ {3:[No Name] [+] }|
+ |1| T {20:123123} {20:22}T TTT {20:090804090}|
+ {20:804} |
+ {1:~ }|*5
+ {2:[Preview] }|
:%s/T\([0-9]\+\)/\1\1/g^ |
]])
end)
@@ -2128,9 +2116,9 @@ describe(':substitute', function()
feed(':%s/T\\([0-9]\\+\\)/\\1\\1/g')
screen:expect([[
- T {12:123123} {12:22}T TTT {12:090804090804} |
+ T {20:123123} {20:22}T TTT {20:090804090804} |
x |
- {15:~ }|*12
+ {1:~ }|*12
:%s/T\([0-9]\+\)/\1\1/g^ |
]])
end)
@@ -2147,17 +2135,17 @@ describe(':substitute', function()
common_setup(screen, 'split', text)
feed(':%s/[QR]\\n')
screen:expect([[
- afa {12:Q} |
- adf la;lkd {12:R} |
+ afa {20:Q} |
+ adf la;lkd {20:R} |
alx |
|
- {15:~ }|
- {11:[No Name] [+] }|
- |3| afa {12:Q} |
- |4|{12: }adf la;lkd {12:R} |
- |5|{12: }alx |
- {15:~ }|*4
- {10:[Preview] }|
+ {1:~ }|
+ {3:[No Name] [+] }|
+ |3| afa {20:Q} |
+ |4|{20: }adf la;lkd {20:R} |
+ |5|{20: }alx |
+ {1:~ }|*4
+ {2:[Preview] }|
:%s/[QR]\n^ |
]])
@@ -2165,13 +2153,13 @@ describe(':substitute', function()
screen:expect([[
T T123 T T123 T2T TT T23423424|
x |
- afa {12:KKK}adf la;lkd {12:KKK}alx |
+ afa {20:KKK}adf la;lkd {20:KKK}alx |
|
- {15:~ }|
- {11:[No Name] [+] }|
- |3| afa {12:KKK}adf la;lkd {12:KKK}alx |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|
+ {3:[No Name] [+] }|
+ |3| afa {20:KKK}adf la;lkd {20:KKK}alx |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/[QR]\n/KKK^ |
]])
end)
@@ -2190,9 +2178,9 @@ describe(':substitute', function()
screen:expect([[
T T123 T T123 T2T TT T23423424|
x |
- afa {12:KKK}adf la;lkd {12:KKK}alx |
+ afa {20:KKK}adf la;lkd {20:KKK}alx |
|
- {15:~ }|*10
+ {1:~ }|*10
:%s/[QR]\n/KKK^ |
]])
end)
@@ -2218,16 +2206,16 @@ describe(':substitute', function()
BBB BB |
CCC CC |
|
- {11:[No Name] [+] }|
+ {3:[No Name] [+] }|
| 1| AAA AA |
- | 2|{12: }BBB BB |
- | 3|{12: }CCC CC |
- | 4|{12: }AAA AA |
- | 5|{12: }BBB BB |
- | 6|{12: }CCC CC |
- | 7|{12: }AAA AA |
- {10:[Preview] }|
- :%s/\n\n/{17:^M}/g^ |
+ | 2|{20: }BBB BB |
+ | 3|{20: }CCC CC |
+ | 4|{20: }AAA AA |
+ | 5|{20: }BBB BB |
+ | 6|{20: }CCC CC |
+ | 7|{20: }AAA AA |
+ {2:[Preview] }|
+ :%s/\n\n/{18:^M}/g^ |
]],
}
assert_alive()
@@ -2261,7 +2249,7 @@ describe(':substitute', function()
BBB BB |
CCC CC |
|
- :%s/\n\n/{17:^M}/g^ |
+ :%s/\n\n/{18:^M}/g^ |
]],
}
assert_alive()
@@ -2271,36 +2259,36 @@ describe(':substitute', function()
common_setup(screen, 'split', multibyte_text)
feed(':%s/£.*ѫ/X¥¥')
screen:expect([[
- a{12:X¥¥}¥KOL |
+ a{20:X¥¥}¥KOL |
£ ¥ libm |
£ ¥ |
|
- {15:~ }|
- {11:[No Name] [+] }|
- |1| {12:X¥¥} PEPPERS |
- |2| {12:X¥¥} |
- |3| a{12:X¥¥}¥KOL |
- {15:~ }|*4
- {10:[Preview] }|
+ {1:~ }|
+ {3:[No Name] [+] }|
+ |1| {20:X¥¥} PEPPERS |
+ |2| {20:X¥¥} |
+ |3| a{20:X¥¥}¥KOL |
+ {1:~ }|*4
+ {2:[Preview] }|
:%s/£.*ѫ/X¥¥^ |
]])
feed('\\ra££ ¥')
screen:expect([[
- a{12:X¥¥} |
- {12:a££ ¥}¥KOL |
+ a{20:X¥¥} |
+ {20:a££ ¥}¥KOL |
£ ¥ libm |
£ ¥ |
|
- {11:[No Name] [+] }|
- |1| {12:X¥¥} |
- |2|{12: a££ ¥} PEPPERS |
- |3| {12:X¥¥} |
- |4|{12: a££ ¥} |
- |5| a{12:X¥¥} |
- |6|{12: a££ ¥}¥KOL |
- {15:~ }|
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| {20:X¥¥} |
+ |2|{20: a££ ¥} PEPPERS |
+ |3| {20:X¥¥} |
+ |4|{20: a££ ¥} |
+ |5| a{20:X¥¥} |
+ |6|{20: a££ ¥}¥KOL |
+ {1:~ }|
+ {2:[Preview] }|
:%s/£.*ѫ/X¥¥\ra££ ¥^ |
]])
end)
@@ -2309,28 +2297,28 @@ describe(':substitute', function()
common_setup(screen, 'nosplit', multibyte_text)
feed(':%s/£.*ѫ/X¥¥')
screen:expect([[
- {12:X¥¥} PEPPERS |
- {12:X¥¥} |
- a{12:X¥¥}¥KOL |
+ {20:X¥¥} PEPPERS |
+ {20:X¥¥} |
+ a{20:X¥¥}¥KOL |
£ ¥ libm |
£ ¥ |
|
- {15:~ }|*8
+ {1:~ }|*8
:%s/£.*ѫ/X¥¥^ |
]])
feed('\\ra££ ¥')
screen:expect([[
- {12:X¥¥} |
- {12:a££ ¥} PEPPERS |
- {12:X¥¥} |
- {12:a££ ¥} |
- a{12:X¥¥} |
- {12:a££ ¥}¥KOL |
+ {20:X¥¥} |
+ {20:a££ ¥} PEPPERS |
+ {20:X¥¥} |
+ {20:a££ ¥} |
+ a{20:X¥¥} |
+ {20:a££ ¥}¥KOL |
£ ¥ libm |
£ ¥ |
|
- {15:~ }|*5
+ {1:~ }|*5
:%s/£.*ѫ/X¥¥\ra££ ¥^ |
]])
end)
@@ -2344,17 +2332,17 @@ describe(':substitute', function()
X Y Z |
7 8 9 |
K L M |
- {12:a} b c |
- {12:d} e f |
- {12:q} r s |
- {12:x} y z |
- £ {12:m} n |
- {12:t} œ ¥ |
+ {20:a} b c |
+ {20:d} e f |
+ {20:q} r s |
+ {20:x} y z |
+ £ {20:m} n |
+ {20:t} œ ¥ |
|
- {11:[No Name] [+] }|
- | 7| {12:a} b c |
- | 8| {12:d} e f |
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ | 7| {20:a} b c |
+ | 8| {20:d} e f |
+ {2:[Preview] }|
:%s/[a-z]^ |
]])
@@ -2363,17 +2351,17 @@ describe(':substitute', function()
X Y Z |
7 8 9 |
K L M |
- {12:JLKR £} b c |
- {12:JLKR £} e f |
- {12:JLKR £} r s |
- {12:JLKR £} y z |
- £ {12:JLKR £} n |
- {12:JLKR £} œ ¥ |
+ {20:JLKR £} b c |
+ {20:JLKR £} e f |
+ {20:JLKR £} r s |
+ {20:JLKR £} y z |
+ £ {20:JLKR £} n |
+ {20:JLKR £} œ ¥ |
|
- {11:[No Name] [+] }|
- | 7| {12:JLKR £} b c |
- | 8| {12:JLKR £} e f |
- {10:[Preview] }|
+ {3:[No Name] [+] }|
+ | 7| {20:JLKR £} b c |
+ | 8| {20:JLKR £} e f |
+ {2:[Preview] }|
:%s/[a-z]/JLKR £^ |
]])
@@ -2381,17 +2369,17 @@ describe(':substitute', function()
screen:expect([[
7 8 9 |
K L M |
- {12:JLKR £} |
- {12:ѫ ab } |
- {12:XXXX} b c |
- {12:JLKR £} |
- {12:ѫ ab } |
- {12:XXXX} e f |
- {12:JLKR £} |
- {12:ѫ ab } |
- {11:[No Name] [+] }|
- | 7| {12:JLKR £} |
- {11: }|
+ {20:JLKR £} |
+ {20:ѫ ab } |
+ {20:XXXX} b c |
+ {20:JLKR £} |
+ {20:ѫ ab } |
+ {20:XXXX} e f |
+ {20:JLKR £} |
+ {20:ѫ ab } |
+ {3:[No Name] [+] }|
+ | 7| {20:JLKR £} |
+ {3: }|
:%s/[a-z]/JLKR £\rѫ ab \rXXX|
X^ |
]])
@@ -2403,58 +2391,58 @@ describe(':substitute', function()
feed(':%s/. .$')
screen:expect([[
- t {12:œ ¥} |
- {11:[No Name] [+] }|
- | 1| 1 {12:2 3} |
- | 2| A {12:B C} |
- | 3| 4 {12:5 6} |
- | 4| X {12:Y Z} |
- | 5| 7 {12:8 9} |
- | 6| K {12:L M} |
- | 7| a {12:b c} |
- | 8| d {12:e f} |
- | 9| q {12:r s} |
- |10| x {12:y z} |
- |11| £ {12:m n} |
- {10:[Preview] }|
+ t {20:œ ¥} |
+ {3:[No Name] [+] }|
+ | 1| 1 {20:2 3} |
+ | 2| A {20:B C} |
+ | 3| 4 {20:5 6} |
+ | 4| X {20:Y Z} |
+ | 5| 7 {20:8 9} |
+ | 6| K {20:L M} |
+ | 7| a {20:b c} |
+ | 8| d {20:e f} |
+ | 9| q {20:r s} |
+ |10| x {20:y z} |
+ |11| £ {20:m n} |
+ {2:[Preview] }|
:%s/. .$^ |
]])
feed('/ YYY')
screen:expect([[
- t {12: YYY} |
- {11:[No Name] [+] }|
- | 1| 1 {12: YYY} |
- | 2| A {12: YYY} |
- | 3| 4 {12: YYY} |
- | 4| X {12: YYY} |
- | 5| 7 {12: YYY} |
- | 6| K {12: YYY} |
- | 7| a {12: YYY} |
- | 8| d {12: YYY} |
- | 9| q {12: YYY} |
- |10| x {12: YYY} |
- |11| £ {12: YYY} |
- {10:[Preview] }|
+ t {20: YYY} |
+ {3:[No Name] [+] }|
+ | 1| 1 {20: YYY} |
+ | 2| A {20: YYY} |
+ | 3| 4 {20: YYY} |
+ | 4| X {20: YYY} |
+ | 5| 7 {20: YYY} |
+ | 6| K {20: YYY} |
+ | 7| a {20: YYY} |
+ | 8| d {20: YYY} |
+ | 9| q {20: YYY} |
+ |10| x {20: YYY} |
+ |11| £ {20: YYY} |
+ {2:[Preview] }|
:%s/. .$/ YYY^ |
]])
feed('\\r KKK')
screen:expect([[
- a {12: YYY} |
- {11:[No Name] [+] }|
- | 1| 1 {12: YYY} |
- | 2|{12: KKK} |
- | 3| A {12: YYY} |
- | 4|{12: KKK} |
- | 5| 4 {12: YYY} |
- | 6|{12: KKK} |
- | 7| X {12: YYY} |
- | 8|{12: KKK} |
- | 9| 7 {12: YYY} |
- |10|{12: KKK} |
- |11| K {12: YYY} |
- {10:[Preview] }|
+ a {20: YYY} |
+ {3:[No Name] [+] }|
+ | 1| 1 {20: YYY} |
+ | 2|{20: KKK} |
+ | 3| A {20: YYY} |
+ | 4|{20: KKK} |
+ | 5| 4 {20: YYY} |
+ | 6|{20: KKK} |
+ | 7| X {20: YYY} |
+ | 8|{20: KKK} |
+ | 9| 7 {20: YYY} |
+ |10|{20: KKK} |
+ |11| K {20: YYY} |
+ {2:[Preview] }|
:%s/. .$/ YYY\r KKK^ |
]])
end)
@@ -2463,14 +2451,14 @@ describe(':substitute', function()
common_setup(screen, 'split', 'something\neverything\nsomeone')
feed([[:%s/\(some\)\@<lt>=thing/one/]])
screen:expect([[
- some{12:one} |
+ some{20:one} |
everything |
someone |
- {15:~ }|*2
- {11:[No Name] [+] }|
- |1| some{12:one} |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|*2
+ {3:[No Name] [+] }|
+ |1| some{20:one} |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/\(some\)\@<=thing/one/^ |
]])
@@ -2480,13 +2468,13 @@ describe(':substitute', function()
feed([[:%s/\(some\)\@<lt>!thing/one/]])
screen:expect([[
something |
- every{12:one} |
+ every{20:one} |
someone |
- {15:~ }|*2
- {11:[No Name] [+] }|
- |2| every{12:one} |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|*2
+ {3:[No Name] [+] }|
+ |2| every{20:one} |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/\(some\)\@<!thing/one/^ |
]])
@@ -2494,14 +2482,14 @@ describe(':substitute', function()
poke_eventloop()
feed([[:%s/some\(thing\)\@=/every/]])
screen:expect([[
- {12:every}thing |
+ {20:every}thing |
everything |
someone |
- {15:~ }|*2
- {11:[No Name] [+] }|
- |1| {12:every}thing |
- {15:~ }|*6
- {10:[Preview] }|
+ {1:~ }|*2
+ {3:[No Name] [+] }|
+ |1| {20:every}thing |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/some\(thing\)\@=/every/^ |
]])
@@ -2511,12 +2499,12 @@ describe(':substitute', function()
screen:expect([[
something |
everything |
- {12:every}one |
- {15:~ }|*2
- {11:[No Name] [+] }|
- |3| {12:every}one |
- {15:~ }|*6
- {10:[Preview] }|
+ {20:every}one |
+ {1:~ }|*2
+ {3:[No Name] [+] }|
+ |3| {20:every}one |
+ {1:~ }|*6
+ {2:[Preview] }|
:%s/some\(thing\)\@!/every/^ |
]])
end)
@@ -2528,23 +2516,23 @@ describe(':substitute', function()
-- substitution preview should have been made, without prompting
screen:expect([[
- {12:MO}o lines |
- {11:[No Name] [+] }|
- |2| {12:MO}o lines |
- {15:~ }|*3
- {10:[Preview] }|
+ {20:MO}o lines |
+ {3:[No Name] [+] }|
+ |2| {20:MO}o lines |
+ {1:~ }|*3
+ {2:[Preview] }|
:2,1s/tw/MO/g^ |
]])
-- but should be prompted on hitting enter
feed('<CR>')
screen:expect([[
- {12:MO}o lines |
- {11:[No Name] [+] }|
- |2| {12:MO}o lines |
- {15:~ }|*3
- {10:[Preview] }|
- {13:Backwards range given, OK to swap (y/n)?}^ |
+ {20:MO}o lines |
+ {3:[No Name] [+] }|
+ |2| {20:MO}o lines |
+ {1:~ }|*3
+ {2:[Preview] }|
+ {6:Backwards range given, OK to swap (y/n)?}^ |
]])
feed('y')
@@ -2552,14 +2540,14 @@ describe(':substitute', function()
Inc substitution on |
^MOo lines |
|
- {15:~ }|*4
- {13:Backwards range given, OK to swap (y/n)?}y |
+ {1:~ }|*4
+ {6:Backwards range given, OK to swap (y/n)?}y |
]])
end)
end)
it(':substitute with inccommand during :terminal activity', function()
- if helpers.skip_fragile(pending) then
+ if t.skip_fragile(pending) then
return
end
retry(2, 40000, function()
@@ -2595,17 +2583,23 @@ it(':substitute with inccommand, timer-induced :redraw #9777', function()
feed(':%s/foo/ZZZ')
sleep(20) -- Allow some timer activity.
screen:expect([[
- {12:ZZZ} bar baz |
+ {20:ZZZ} bar baz |
bar baz fox |
- bar {12:ZZZ} baz |
- {15:~ }|*3
- {11:[No Name] [+] }|
- |1| {12:ZZZ} bar baz |
- |3| bar {12:ZZZ} baz |
- {15:~ }|
- {10:[Preview] }|
+ bar {20:ZZZ} baz |
+ {1:~ }|*3
+ {3:[No Name] [+] }|
+ |1| {20:ZZZ} bar baz |
+ |3| bar {20:ZZZ} baz |
+ {1:~ }|
+ {2:[Preview] }|
:%s/foo/ZZZ^ |
]])
+
+ -- Also with nvim__redraw()
+ command('call timer_start(10, {-> nvim__redraw(#{flush:1})}, {"repeat":-1})')
+ command('call timer_start(10, {-> nvim__redraw(#{statusline:1})}, {"repeat":-1})')
+ sleep(20) -- Allow some timer activity.
+ screen:expect_unchanged()
end)
it(':substitute with inccommand, allows :redraw before first separator is typed #18857', function()
@@ -2627,8 +2621,8 @@ it(':substitute with inccommand, allows :redraw before first separator is typed
foo bar baz |
bar baz fox |
bar foo baz |
- {16: }{15: }|
- {15:~ }|
+ {21: }{1: }|
+ {1:~ }|
:^ |
]])
feed('%s')
@@ -2636,8 +2630,8 @@ it(':substitute with inccommand, allows :redraw before first separator is typed
foo bar baz |
bar baz fox |
bar foo baz |
- {16: }{15: }|
- {15:~ }|
+ {21: }{1: }|
+ {1:~ }|
:%s^ |
]])
api.nvim_buf_set_lines(float_buf, 0, -1, true, { 'foo' })
@@ -2646,8 +2640,8 @@ it(':substitute with inccommand, allows :redraw before first separator is typed
foo bar baz |
bar baz fox |
bar foo baz |
- {16:foo }{15: }|
- {15:~ }|
+ {21:foo }{1: }|
+ {1:~ }|
:%s^ |
]])
end)
@@ -2659,7 +2653,7 @@ it(':substitute with inccommand, does not crash if range contains invalid marks'
feed([[:'a,'bs]])
screen:expect([[
test |
- {15:~ }|*4
+ {1:~ }|*4
:'a,'bs^ |
]])
-- v:errmsg shouldn't be set either before the first separator is typed
@@ -2667,7 +2661,7 @@ it(':substitute with inccommand, does not crash if range contains invalid marks'
feed('/')
screen:expect([[
test |
- {15:~ }|*4
+ {1:~ }|*4
:'a,'bs/^ |
]])
end)
@@ -2679,18 +2673,18 @@ it(':substitute with inccommand, no unnecessary redraw if preview is not shown',
feed(':ls<CR>')
screen:expect([[
test |
- {15:~ }|
- {11: }|
+ {1:~ }|
+ {3: }|
:ls |
1 %a + "[No Name]" line 1 |
- {13:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed(':s')
-- no unnecessary redraw, so messages are still shown
screen:expect([[
test |
- {15:~ }|
- {11: }|
+ {1:~ }|
+ {3: }|
:ls |
1 %a + "[No Name]" line 1 |
:s^ |
@@ -2698,8 +2692,8 @@ it(':substitute with inccommand, no unnecessary redraw if preview is not shown',
feed('o')
screen:expect([[
test |
- {15:~ }|
- {11: }|
+ {1:~ }|
+ {3: }|
:ls |
1 %a + "[No Name]" line 1 |
:so^ |
@@ -2707,8 +2701,8 @@ it(':substitute with inccommand, no unnecessary redraw if preview is not shown',
feed('<BS>')
screen:expect([[
test |
- {15:~ }|
- {11: }|
+ {1:~ }|
+ {3: }|
:ls |
1 %a + "[No Name]" line 1 |
:s^ |
@@ -2716,8 +2710,8 @@ it(':substitute with inccommand, no unnecessary redraw if preview is not shown',
feed('/test')
-- now inccommand is shown, so screen is redrawn
screen:expect([[
- {12:test} |
- {15:~ }|*4
+ {20:test} |
+ {1:~ }|*4
:s/test^ |
]])
end)
@@ -2733,8 +2727,8 @@ it(":substitute doesn't crash with inccommand, if undo is empty #12932", functio
sleep(100)
feed('f')
screen:expect([[
- {12:f} |
- {15:~ }|*3
+ {20:f} |
+ {1:~ }|*3
:%s/test/f^ |
]])
assert_alive()
@@ -2756,11 +2750,11 @@ it(':substitute with inccommand works properly if undo is not synced #20029', fu
]])
feed('hjkl')
screen:expect([[
- aaaaa {12:hjkl} |
+ aaaaa {20:hjkl} |
foo |
bar |
baz |
- bbbbb {12:hjkl} |
+ bbbbb {20:hjkl} |
:'<,'>s/asdf/hjkl^ |
]])
feed('<CR>')
@@ -2784,25 +2778,25 @@ it(':substitute with inccommand does not unexpectedly change viewport #25697', f
command('vnew | tabnew | tabclose')
screen:expect([[
^ │£ m n |
- {15:~ }│t œ ¥ |
- {15:~ }│ |
- {11:[No Name] }{10:[No Name] [+] }|
+ {1:~ }│t œ ¥ |
+ {1:~ }│ |
+ {3:[No Name] }{2:[No Name] [+] }|
|
]])
feed(':s/')
screen:expect([[
│£ m n |
- {15:~ }│t œ ¥ |
- {15:~ }│ |
- {11:[No Name] }{10:[No Name] [+] }|
+ {1:~ }│t œ ¥ |
+ {1:~ }│ |
+ {3:[No Name] }{2:[No Name] [+] }|
:s/^ |
]])
feed('<Esc>')
screen:expect([[
^ │£ m n |
- {15:~ }│t œ ¥ |
- {15:~ }│ |
- {11:[No Name] }{10:[No Name] [+] }|
+ {1:~ }│t œ ¥ |
+ {1:~ }│ |
+ {3:[No Name] }{2:[No Name] [+] }|
|
]])
end)
@@ -2836,7 +2830,7 @@ it('long :%s/ with inccommand does not collapse cmdline', function()
)
screen:expect([[
|
- {11: }|
+ {3: }|
:%s/AAAAAAAA|
AAAAAAAAAAAA|
AAAAAAA^ |
@@ -2850,7 +2844,7 @@ it("with 'inccommand' typing invalid `={expr}` does not show error", function()
feed(':edit `=`')
screen:expect([[
|
- {15:~ }|*4
+ {1:~ }|*4
:edit `=`^ |
]])
end)
@@ -2903,26 +2897,26 @@ it("'inccommand' value can be changed multiple times #27086", function()
for _ = 1, 3 do
feed(':%s/foo/bar')
screen:expect([[
- {12:bar}1 |
- {12:bar}2 |
- {12:bar}3 |
- {15:~ }|*7
- {11:[No Name] [+] }|
- |1| {12:bar}1 |
- |2| {12:bar}2 |
- |3| {12:bar}3 |
- {15:~ }|*4
- {10:[Preview] }|
+ {20:bar}1 |
+ {20:bar}2 |
+ {20:bar}3 |
+ {1:~ }|*7
+ {3:[No Name] [+] }|
+ |1| {20:bar}1 |
+ |2| {20:bar}2 |
+ |3| {20:bar}3 |
+ {1:~ }|*4
+ {2:[Preview] }|
:%s/foo/bar^ |
]])
feed('<Esc>')
command('set inccommand=nosplit')
feed(':%s/foo/bar')
screen:expect([[
- {12:bar}1 |
- {12:bar}2 |
- {12:bar}3 |
- {15:~ }|*16
+ {20:bar}1 |
+ {20:bar}2 |
+ {20:bar}3 |
+ {1:~ }|*16
:%s/foo/bar^ |
]])
feed('<Esc>')
@@ -2938,10 +2932,10 @@ it("'inccommand' disables preview if preview buffer can't be created #27086", fu
eq('split', api.nvim_get_option_value('inccommand', {}))
feed(':%s/foo/bar')
screen:expect([[
- {12:bar}1 |
- {12:bar}2 |
- {12:bar}3 |
- {15:~ }|*16
+ {20:bar}1 |
+ {20:bar}2 |
+ {20:bar}3 |
+ {1:~ }|*16
:%s/foo/bar^ |
]])
eq('nosplit', api.nvim_get_option_value('inccommand', {}))
diff --git a/test/functional/ui/inccommand_user_spec.lua b/test/functional/ui/inccommand_user_spec.lua
index a714df72b7..12f3640b54 100644
--- a/test/functional/ui/inccommand_user_spec.lua
+++ b/test/functional/ui/inccommand_user_spec.lua
@@ -1,13 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local api = helpers.api
-local clear = helpers.clear
-local eq = helpers.eq
-local exec_lua = helpers.exec_lua
-local insert = helpers.insert
-local feed = helpers.feed
-local command = helpers.command
-local assert_alive = helpers.assert_alive
+
+local api = n.api
+local clear = n.clear
+local eq = t.eq
+local exec_lua = n.exec_lua
+local insert = n.insert
+local feed = n.feed
+local command = n.command
+local assert_alive = n.assert_alive
-- Implements a :Replace command that works like :substitute and has multibuffer support.
local setup_replace_cmd = [[
@@ -237,13 +239,6 @@ describe("'inccommand' for user commands", function()
before_each(function()
clear()
screen = Screen.new(40, 17)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Yellow1 },
- [2] = { foreground = Screen.colors.Blue1, bold = true },
- [3] = { reverse = true },
- [4] = { reverse = true, bold = true },
- [5] = { foreground = Screen.colors.Blue },
- })
screen:attach()
exec_lua(setup_replace_cmd)
command('set cmdwinheight=5')
@@ -263,16 +258,16 @@ describe("'inccommand' for user commands", function()
command('set inccommand=nosplit')
feed(':Replace text cats')
screen:expect([[
- {1:cats} on line 1 |
- more {1:cats} on line 2 |
- oh no, even more {1:cats} |
- will the {1:cats} ever stop |
+ {10:cats} on line 1 |
+ more {10:cats} on line 2 |
+ oh no, even more {10:cats} |
+ will the {10:cats} ever stop |
oh well |
- did the {1:cats} stop |
+ did the {10:cats} stop |
why won't it stop |
- make the {1:cats} stop |
+ make the {10:cats} stop |
|
- {2:~ }|*7
+ {1:~ }|*7
:Replace text cats^ |
]])
end)
@@ -281,22 +276,22 @@ describe("'inccommand' for user commands", function()
command('set inccommand=split')
feed(':Replace text cats')
screen:expect([[
- {1:cats} on line 1 |
- more {1:cats} on line 2 |
- oh no, even more {1:cats} |
- will the {1:cats} ever stop |
+ {10:cats} on line 1 |
+ more {10:cats} on line 2 |
+ oh no, even more {10:cats} |
+ will the {10:cats} ever stop |
oh well |
- did the {1:cats} stop |
+ did the {10:cats} stop |
why won't it stop |
- make the {1:cats} stop |
+ make the {10:cats} stop |
|
- {4:[No Name] [+] }|
- |1| {1:cats} on line 1 |
- |2| more {1:cats} on line 2 |
- |3| oh no, even more {1:cats} |
- |4| will the {1:cats} ever stop |
- |6| did the {1:cats} stop |
- {3:[Preview] }|
+ {3:[No Name] [+] }|
+ |1| {10:cats} on line 1 |
+ |2| more {10:cats} on line 2 |
+ |3| oh no, even more {10:cats} |
+ |4| will the {10:cats} ever stop |
+ |6| did the {10:cats} stop |
+ {2:[Preview] }|
:Replace text cats^ |
]])
end)
@@ -314,7 +309,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
^ |
- {2:~ }|*7
+ {1:~ }|*7
|
]])
end)
@@ -332,7 +327,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the cats stop |
^ |
- {2:~ }|*7
+ {1:~ }|*7
:Replace text cats |
]])
end)
@@ -341,7 +336,7 @@ describe("'inccommand' for user commands", function()
command('set inccommand=split')
feed('gg:.Replace text cats')
screen:expect([[
- {1:cats} on line 1 |
+ {10:cats} on line 1 |
more text on line 2 |
oh no, even more text |
will the text ever stop |
@@ -350,7 +345,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
|
- {2:~ }|*7
+ {1:~ }|*7
:.Replace text cats^ |
]])
end)
@@ -394,7 +389,7 @@ describe("'inccommand' for user commands", function()
]])
feed(':C')
screen:expect([[
- {1: cats on line 1} |
+ {10: cats on line 1} |
more cats on line 2 |
oh no, even more cats |
will the cats ever stop |
@@ -403,7 +398,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the cats stop |
|
- {2:~ }|*7
+ {1:~ }|*7
:C^ |
]])
assert_alive()
@@ -453,7 +448,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
a.a.a.a. |
- {2:~ }|*7
+ {1:~ }|*7
:Test a.a.a.a.^ |
]])
feed('<C-V><Esc>u')
@@ -467,8 +462,8 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
a.a.a. |
- {2:~ }|*7
- :Test a.a.a.a.{5:^[}u^ |
+ {1:~ }|*7
+ :Test a.a.a.a.{18:^[}u^ |
]])
feed('<Esc>')
screen:expect([[
@@ -481,7 +476,7 @@ describe("'inccommand' for user commands", function()
why won't it stop |
make the text stop |
^ |
- {2:~ }|*7
+ {1:~ }|*7
|
]])
end
@@ -521,12 +516,6 @@ describe("'inccommand' with multiple buffers", function()
before_each(function()
clear()
screen = Screen.new(40, 17)
- screen:set_default_attr_ids({
- [1] = { background = Screen.colors.Yellow1 },
- [2] = { foreground = Screen.colors.Blue1, bold = true },
- [3] = { reverse = true },
- [4] = { reverse = true, bold = true },
- })
screen:attach()
exec_lua(setup_replace_cmd)
command('set cmdwinheight=10')
@@ -547,12 +536,12 @@ describe("'inccommand' with multiple buffers", function()
command('set inccommand=nosplit')
feed(':Replace foo bar')
screen:expect([[
- bar baz {1:bar} │ {1:bar} bar baz |
- baz {1:bar} bar │ bar baz {1:bar} |
- {1:bar} bar baz │ baz {1:bar} bar |
+ bar baz {10:bar} │ {10:bar} bar baz |
+ baz {10:bar} bar │ bar baz {10:bar} |
+ {10:bar} bar baz │ baz {10:bar} bar |
│ |
- {2:~ }│{2:~ }|*11
- {4:[No Name] [+] }{3:[No Name] [+] }|
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
:Replace foo bar^ |
]])
feed('<CR>')
@@ -561,8 +550,8 @@ describe("'inccommand' with multiple buffers", function()
baz bar bar │ bar baz bar |
bar bar baz │ baz bar bar |
^ │ |
- {2:~ }│{2:~ }|*11
- {4:[No Name] [+] }{3:[No Name] [+] }|
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
:Replace foo bar |
]])
end)
@@ -571,22 +560,22 @@ describe("'inccommand' with multiple buffers", function()
command('set inccommand=split')
feed(':Replace foo bar')
screen:expect([[
- bar baz {1:bar} │ {1:bar} bar baz |
- baz {1:bar} bar │ bar baz {1:bar} |
- {1:bar} bar baz │ baz {1:bar} bar |
+ bar baz {10:bar} │ {10:bar} bar baz |
+ baz {10:bar} bar │ bar baz {10:bar} |
+ {10:bar} bar baz │ baz {10:bar} bar |
│ |
- {4:[No Name] [+] }{3:[No Name] [+] }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
Buffer #1: |
- |1| {1:bar} bar baz |
- |2| bar baz {1:bar} |
- |3| baz {1:bar} bar |
+ |1| {10:bar} bar baz |
+ |2| bar baz {10:bar} |
+ |3| baz {10:bar} bar |
Buffer #2: |
- |1| bar baz {1:bar} |
- |2| baz {1:bar} bar |
- |3| {1:bar} bar baz |
+ |1| bar baz {10:bar} |
+ |2| baz {10:bar} bar |
+ |3| {10:bar} bar baz |
|
- {2:~ }|
- {3:[Preview] }|
+ {1:~ }|
+ {2:[Preview] }|
:Replace foo bar^ |
]])
feed('<CR>')
@@ -595,8 +584,8 @@ describe("'inccommand' with multiple buffers", function()
baz bar bar │ bar baz bar |
bar bar baz │ baz bar bar |
^ │ |
- {2:~ }│{2:~ }|*11
- {4:[No Name] [+] }{3:[No Name] [+] }|
+ {1:~ }│{1:~ }|*11
+ {3:[No Name] [+] }{2:[No Name] [+] }|
:Replace foo bar |
]])
end)
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua
index b2899bf82d..f377939458 100644
--- a/test/functional/ui/input_spec.lua
+++ b/test/functional/ui/input_spec.lua
@@ -1,16 +1,18 @@
-local helpers = require('test.functional.helpers')(after_each)
-local clear, feed_command = helpers.clear, helpers.feed_command
-local feed, next_msg, eq = helpers.feed, helpers.next_msg, helpers.eq
-local command = helpers.command
-local expect = helpers.expect
-local curbuf_contents = helpers.curbuf_contents
-local api = helpers.api
-local exec_lua = helpers.exec_lua
-local write_file = helpers.write_file
-local fn = helpers.fn
-local eval = helpers.eval
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
+local clear, feed_command = n.clear, n.feed_command
+local feed, next_msg, eq = n.feed, n.next_msg, t.eq
+local command = n.command
+local expect = n.expect
+local curbuf_contents = n.curbuf_contents
+local api = n.api
+local exec_lua = n.exec_lua
+local write_file = t.write_file
+local fn = n.fn
+local eval = n.eval
+
before_each(clear)
describe('mappings', function()
@@ -280,21 +282,16 @@ end)
it('typing a simplifiable key at hit-enter prompt triggers mapping vim-patch:8.2.0839', function()
local screen = Screen.new(60, 8)
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
- [2] = { bold = true, reverse = true }, -- MsgSeparator
- [3] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg
- })
screen:attach()
command([[nnoremap <C-6> <Cmd>echo 'hit ctrl-6'<CR>]])
feed_command('ls')
screen:expect([[
|
{1:~ }|*3
- {2: }|
+ {3: }|
:ls |
1 %a "[No Name]" line 1 |
- {3:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<C-6>')
screen:expect([[
@@ -331,12 +328,6 @@ describe('input non-printable chars', function()
it("doesn't crash when echoing them back", function()
write_file('Xtest-overwrite', [[foobar]])
local screen = Screen.new(60, 8)
- screen:set_default_attr_ids {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [4] = { bold = true, reverse = true },
- }
screen:attach()
command('set shortmess-=F')
@@ -347,52 +338,52 @@ describe('input non-printable chars', function()
"Xtest-overwrite" [noeol] 1L, 6B |
]])
- -- The timestamp is in second resolution, wait two seconds to be sure.
- screen:sleep(2000)
+ -- Wait for some time so that the timestamp changes.
+ vim.uv.sleep(10)
write_file('Xtest-overwrite', [[smurf]])
feed_command('w')
screen:expect([[
foobar |
{1:~ }|*3
- {4: }|
+ {3: }|
"Xtest-overwrite" |
- {2:WARNING: The file has been changed since reading it!!!} |
- {3:Do you really want to write to it (y/n)?}^ |
+ {9:WARNING: The file has been changed since reading it!!!} |
+ {6:Do you really want to write to it (y/n)?}^ |
]])
feed('u')
screen:expect([[
foobar |
{1:~ }|*2
- {4: }|
+ {3: }|
"Xtest-overwrite" |
- {2:WARNING: The file has been changed since reading it!!!} |
- {3:Do you really want to write to it (y/n)?}u |
- {3:Do you really want to write to it (y/n)?}^ |
+ {9:WARNING: The file has been changed since reading it!!!} |
+ {6:Do you really want to write to it (y/n)?}u |
+ {6:Do you really want to write to it (y/n)?}^ |
]])
feed('\005')
screen:expect([[
foobar |
{1:~ }|
- {4: }|
+ {3: }|
"Xtest-overwrite" |
- {2:WARNING: The file has been changed since reading it!!!} |
- {3:Do you really want to write to it (y/n)?}u |
- {3:Do you really want to write to it (y/n)?} |
- {3:Do you really want to write to it (y/n)?}^ |
+ {9:WARNING: The file has been changed since reading it!!!} |
+ {6:Do you really want to write to it (y/n)?}u |
+ {6:Do you really want to write to it (y/n)?} |
+ {6:Do you really want to write to it (y/n)?}^ |
]])
feed('n')
screen:expect([[
foobar |
- {4: }|
+ {3: }|
"Xtest-overwrite" |
- {2:WARNING: The file has been changed since reading it!!!} |
- {3:Do you really want to write to it (y/n)?}u |
- {3:Do you really want to write to it (y/n)?} |
- {3:Do you really want to write to it (y/n)?}n |
- {3:Press ENTER or type command to continue}^ |
+ {9:WARNING: The file has been changed since reading it!!!} |
+ {6:Do you really want to write to it (y/n)?}u |
+ {6:Do you really want to write to it (y/n)?} |
+ {6:Do you really want to write to it (y/n)?}n |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@@ -437,10 +428,6 @@ describe('display is updated', function()
local screen
before_each(function()
screen = Screen.new(60, 8)
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText
- [2] = { bold = true }, -- ModeMsg
- })
screen:attach()
end)
@@ -452,7 +439,7 @@ describe('display is updated', function()
abc |
^ |
{1:~ }|*5
- {2:-- INSERT --} |
+ {5:-- INSERT --} |
]])
end)
@@ -464,7 +451,7 @@ describe('display is updated', function()
abc |
^ |
{1:~ }|*5
- {2:-- INSERT --} |
+ {5:-- INSERT --} |
]])
end)
end)
diff --git a/test/functional/ui/linematch_spec.lua b/test/functional/ui/linematch_spec.lua
index 40df5cadf1..03eed5a49c 100644
--- a/test/functional/ui/linematch_spec.lua
+++ b/test/functional/ui/linematch_spec.lua
@@ -1,9 +1,10 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local feed = helpers.feed
-local clear = helpers.clear
-local write_file = helpers.write_file
+local feed = n.feed
+local clear = n.clear
+local write_file = t.write_file
describe('Diff mode screen with 3 diffs open', function()
local fname = 'Xtest-functional-diff-screen-1'
@@ -38,18 +39,6 @@ describe('Diff mode screen with 3 diffs open', function()
screen = Screen.new(100, 16)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray },
- [2] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.LightCyan1 },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.LightBlue },
- [5] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray },
- [6] = { foreground = Screen.colors.Blue1, bold = true },
- [7] = { reverse = true, bold = true },
- [8] = { background = Screen.colors.Red1, bold = true },
- [10] = { foreground = Screen.colors.Brown },
- [9] = { background = Screen.colors.Plum1 },
- })
feed('<c-w>=')
feed(':windo set nu!<cr>')
end)
@@ -96,20 +85,20 @@ describe('Diff mode screen with 3 diffs open', function()
feed('1<c-w>w')
feed(':2,6diffget screen-1.2<cr>')
screen:expect([[
- {1: }{10: 1 }^ │{1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }{9:<<<<<<< HEAD }│{1: }{10: 3 }{9:<<<<<<< HEAD }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 4 } AAA │{1: }{10: 4 } AAA │{1: }{10: 3 } AAA |
- {1: }{10: 5 } AAA │{1: }{10: 5 } AAA │{1: }{10: 4 } AAA |
- {1: }{10: 6 } AAA │{1: }{10: 6 } AAA │{1: }{10: 5 } AAA |
- {1: }{10: 7 }{9:======= }│{1: }{10: 7 }{9:======= }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 8 }{9: BBB }│{1: }{10: 8 }{9: BBB }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 9 }{9: BBB }│{1: }{10: 9 }{9: BBB }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 10 }{9: BBB }│{1: }{10: 10 }{9: BBB }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 12 } │{1: }{10: 12 } │{1: }{10: 6 } |
- {6:~ }│{6:~ }│{6:~ }|*2
- {7:<-functional-diff-screen-1.3 [+] }{3:<est-functional-diff-screen-1.2 Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }^ │{7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }{4:<<<<<<< HEAD }│{7: }{8: 3 }{4:<<<<<<< HEAD }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 4 } AAA │{7: }{8: 4 } AAA │{7: }{8: 3 } AAA |
+ {7: }{8: 5 } AAA │{7: }{8: 5 } AAA │{7: }{8: 4 } AAA |
+ {7: }{8: 6 } AAA │{7: }{8: 6 } AAA │{7: }{8: 5 } AAA |
+ {7: }{8: 7 }{4:======= }│{7: }{8: 7 }{4:======= }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 8 }{4: BBB }│{7: }{8: 8 }{4: BBB }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 9 }{4: BBB }│{7: }{8: 9 }{4: BBB }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 10 }{4: BBB }│{7: }{8: 10 }{4: BBB }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 11 }{4:>>>>>>> branch1 }│{7: }{8: 11 }{4:>>>>>>> branch1 }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 12 } │{7: }{8: 12 } │{7: }{8: 6 } |
+ {1:~ }│{1:~ }│{1:~ }|*2
+ {3:<-functional-diff-screen-1.3 [+] }{2:<est-functional-diff-screen-1.2 Xtest-functional-diff-screen-1 }|
:2,6diffget screen-1.2 |
]])
end)
@@ -118,17 +107,17 @@ describe('Diff mode screen with 3 diffs open', function()
feed('2<c-w>w')
feed(':5,7diffget screen-1.3<cr>')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 }^ │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: }{2:---------------------------}│{1: }{10: 3 }{4:<<<<<<< HEAD }│{1: }{10: }{2:---------------------------}|
- {1: }{10: }{2:---------------------------}│{1: }{10: 4 }{9: AAA }│{1: }{10: 3 }{9: AAA }|
- {1: }{10: 3 }{9: BBB }│{1: }{10: 5 }{9: BBB }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 4 }{9: }{8:BBB}{9: }│{1: }{10: 6 }{9: }{8:BBB}{9: }│{1: }{10: 4 }{9: }{8:AAA}{9: }|
- {1: }{10: 5 }{9: }{8:BBB}{9: }│{1: }{10: 7 }{9: }{8:BBB}{9: }│{1: }{10: 5 }{9: }{8:AAA}{9: }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 8 }{4:>>>>>>> branch1 }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 6 } │{1: }{10: 9 } │{1: }{10: 6 } |
- {6:~ }│{6:~ }│{6:~ }|*5
- {3:<test-functional-diff-screen-1.3 }{7:<functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 }^ │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: }{23:---------------------------}│{7: }{8: 3 }{22:<<<<<<< HEAD }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 4 }{4: AAA }│{7: }{8: 3 }{4: AAA }|
+ {7: }{8: 3 }{4: BBB }│{7: }{8: 5 }{4: BBB }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 4 }{4: }{27:BBB}{4: }│{7: }{8: 6 }{4: }{27:BBB}{4: }│{7: }{8: 4 }{4: }{27:AAA}{4: }|
+ {7: }{8: 5 }{4: }{27:BBB}{4: }│{7: }{8: 7 }{4: }{27:BBB}{4: }│{7: }{8: 5 }{4: }{27:AAA}{4: }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 8 }{22:>>>>>>> branch1 }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 6 } │{7: }{8: 9 } │{7: }{8: 6 } |
+ {1:~ }│{1:~ }│{1:~ }|*5
+ {2:<test-functional-diff-screen-1.3 }{3:<functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:5,7diffget screen-1.3 |
]])
end)
@@ -137,20 +126,20 @@ describe('Diff mode screen with 3 diffs open', function()
feed('3<c-w>w')
feed(':5,6diffget screen-1.2<cr>')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } │{1: }{10: 1 }^ |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: }{2:---------------------------}│{1: }{10: 3 }{4:<<<<<<< HEAD }│{1: }{10: }{2:---------------------------}|
- {1: }{10: }{2:---------------------------}│{1: }{10: 4 }{9: AAA }│{1: }{10: 3 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 5 }{9: AAA }│{1: }{10: 4 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 6 }{9: AAA }│{1: }{10: 5 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 7 }{9:======= }│{1: }{10: 6 }{9:======= }|
- {1: }{10: 3 } BBB │{1: }{10: 8 } BBB │{1: }{10: 7 } BBB |
- {1: }{10: 4 } BBB │{1: }{10: 9 } BBB │{1: }{10: 8 } BBB |
- {1: }{10: 5 } BBB │{1: }{10: 10 } BBB │{1: }{10: 9 } BBB |
- {1: }{10: }{2:---------------------------}│{1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: 10 }{9:>>>>>>> branch1 }|
- {1: }{10: 6 } │{1: }{10: 12 } │{1: }{10: 11 } |
- {6:~ }│{6:~ }│{6:~ }|*2
- {3:<test-functional-diff-screen-1.3 <est-functional-diff-screen-1.2 }{7:<st-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 } │{7: }{8: 1 }^ |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: }{23:---------------------------}│{7: }{8: 3 }{22:<<<<<<< HEAD }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 4 }{4: AAA }│{7: }{8: 3 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 5 }{4: AAA }│{7: }{8: 4 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 6 }{4: AAA }│{7: }{8: 5 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 7 }{4:======= }│{7: }{8: 6 }{4:======= }|
+ {7: }{8: 3 } BBB │{7: }{8: 8 } BBB │{7: }{8: 7 } BBB |
+ {7: }{8: 4 } BBB │{7: }{8: 9 } BBB │{7: }{8: 8 } BBB |
+ {7: }{8: 5 } BBB │{7: }{8: 10 } BBB │{7: }{8: 9 } BBB |
+ {7: }{8: }{23:---------------------------}│{7: }{8: 11 }{4:>>>>>>> branch1 }│{7: }{8: 10 }{4:>>>>>>> branch1 }|
+ {7: }{8: 6 } │{7: }{8: 12 } │{7: }{8: 11 } |
+ {1:~ }│{1:~ }│{1:~ }|*2
+ {2:<test-functional-diff-screen-1.3 <est-functional-diff-screen-1.2 }{3:<st-functional-diff-screen-1 [+] }|
:5,6diffget screen-1.2 |
]])
end)
@@ -159,20 +148,20 @@ describe('Diff mode screen with 3 diffs open', function()
feed('2<c-w>w')
feed(':6,8diffput screen-1<cr>')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 }^ │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: }{2:---------------------------}│{1: }{10: 3 }{4:<<<<<<< HEAD }│{1: }{10: }{2:---------------------------}|
- {1: }{10: }{2:---------------------------}│{1: }{10: 4 }{9: AAA }│{1: }{10: 3 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 5 }{9: AAA }│{1: }{10: 4 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 6 }{9: AAA }│{1: }{10: 5 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 7 }{9:======= }│{1: }{10: 6 }{9:======= }|
- {1: }{10: 3 }{9: BBB }│{1: }{10: 8 }{9: BBB }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 4 }{9: BBB }│{1: }{10: 9 }{9: BBB }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 5 } BBB │{1: }{10: 10 } BBB │{1: }{10: 7 } BBB |
- {1: }{10: }{2:---------------------------}│{1: }{10: 11 }{4:>>>>>>> branch1 }│{1: }{10: }{2:---------------------------}|
- {1: }{10: 6 } │{1: }{10: 12 } │{1: }{10: 8 } |
- {6:~ }│{6:~ }│{6:~ }|*2
- {3:<test-functional-diff-screen-1.3 }{7:<est-functional-diff-screen-1.2 }{3:<st-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 }^ │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: }{23:---------------------------}│{7: }{8: 3 }{22:<<<<<<< HEAD }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 4 }{4: AAA }│{7: }{8: 3 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 5 }{4: AAA }│{7: }{8: 4 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 6 }{4: AAA }│{7: }{8: 5 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 7 }{4:======= }│{7: }{8: 6 }{4:======= }|
+ {7: }{8: 3 }{4: BBB }│{7: }{8: 8 }{4: BBB }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 4 }{4: BBB }│{7: }{8: 9 }{4: BBB }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 5 } BBB │{7: }{8: 10 } BBB │{7: }{8: 7 } BBB |
+ {7: }{8: }{23:---------------------------}│{7: }{8: 11 }{22:>>>>>>> branch1 }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: 6 } │{7: }{8: 12 } │{7: }{8: 8 } |
+ {1:~ }│{1:~ }│{1:~ }|*2
+ {2:<test-functional-diff-screen-1.3 }{3:<est-functional-diff-screen-1.2 }{2:<st-functional-diff-screen-1 [+] }|
:6,8diffput screen-1 |
]])
end)
@@ -180,20 +169,20 @@ describe('Diff mode screen with 3 diffs open', function()
feed('2<c-w>w')
feed(':6,11diffput screen-1<cr>')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 }^ │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: }{2:---------------------------}│{1: }{10: 3 }{4:<<<<<<< HEAD }│{1: }{10: }{2:---------------------------}|
- {1: }{10: }{2:---------------------------}│{1: }{10: 4 }{9: AAA }│{1: }{10: 3 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 5 }{9: AAA }│{1: }{10: 4 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 6 }{9: AAA }│{1: }{10: 5 }{9: AAA }|
- {1: }{10: }{2:---------------------------}│{1: }{10: 7 }{9:======= }│{1: }{10: 6 }{9:======= }|
- {1: }{10: 3 } BBB │{1: }{10: 8 } BBB │{1: }{10: 7 } BBB |
- {1: }{10: 4 } BBB │{1: }{10: 9 } BBB │{1: }{10: 8 } BBB |
- {1: }{10: 5 } BBB │{1: }{10: 10 } BBB │{1: }{10: 9 } BBB |
- {1: }{10: }{2:---------------------------}│{1: }{10: 11 }{9:>>>>>>> branch1 }│{1: }{10: 10 }{9:>>>>>>> branch1 }|
- {1: }{10: 6 } │{1: }{10: 12 } │{1: }{10: 11 } |
- {6:~ }│{6:~ }│{6:~ }|*2
- {3:<test-functional-diff-screen-1.3 }{7:<est-functional-diff-screen-1.2 }{3:<st-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 }^ │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: }{23:---------------------------}│{7: }{8: 3 }{22:<<<<<<< HEAD }│{7: }{8: }{23:---------------------------}|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 4 }{4: AAA }│{7: }{8: 3 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 5 }{4: AAA }│{7: }{8: 4 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 6 }{4: AAA }│{7: }{8: 5 }{4: AAA }|
+ {7: }{8: }{23:---------------------------}│{7: }{8: 7 }{4:======= }│{7: }{8: 6 }{4:======= }|
+ {7: }{8: 3 } BBB │{7: }{8: 8 } BBB │{7: }{8: 7 } BBB |
+ {7: }{8: 4 } BBB │{7: }{8: 9 } BBB │{7: }{8: 8 } BBB |
+ {7: }{8: 5 } BBB │{7: }{8: 10 } BBB │{7: }{8: 9 } BBB |
+ {7: }{8: }{23:---------------------------}│{7: }{8: 11 }{4:>>>>>>> branch1 }│{7: }{8: 10 }{4:>>>>>>> branch1 }|
+ {7: }{8: 6 } │{7: }{8: 12 } │{7: }{8: 11 } |
+ {1:~ }│{1:~ }│{1:~ }|*2
+ {2:<test-functional-diff-screen-1.3 }{3:<est-functional-diff-screen-1.2 }{2:<st-functional-diff-screen-1 [+] }|
:6,11diffput screen-1 |
]])
end)
@@ -229,18 +218,6 @@ describe('Diff mode screen with 2 diffs open', function()
screen = Screen.new(100, 20)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray },
- [2] = { foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.LightCyan1 },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.LightBlue },
- [5] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray },
- [6] = { foreground = Screen.colors.Blue1, bold = true },
- [7] = { reverse = true, bold = true },
- [8] = { background = Screen.colors.Red1, bold = true },
- [10] = { foreground = Screen.colors.Brown },
- [9] = { background = Screen.colors.Plum1 },
- })
feed('<c-w>=')
feed(':windo set nu!<cr>')
end)
@@ -290,20 +267,20 @@ something
feed('1<c-w>w')
feed(':5,9diffget<cr>')
screen:expect([[
- {1:+ }{10: 1 }{5:^+-- 7 lines: common line··················}│{1:+ }{10: 1 }{5:+-- 7 lines: common line···················}|
- {1: }{10: 8 }xyz │{1: }{10: 8 }xyz |
- {1: }{10: 9 }DEFabc │{1: }{10: 9 }DEFabc |
- {1: }{10: 10 }DEFabc │{1: }{10: 10 }DEFabc |
- {1: }{10: 11 }DEFabc │{1: }{10: 11 }DEFabc |
- {1: }{10: 12 }common line │{1: }{10: 12 }common line |
- {1: }{10: 13 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 14 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 15 }something │{1: }{10: 17 }something |
- {1: }{10: 16 } │{1: }{10: 18 } |
- {6:~ }│{6:~ }|*6
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7:+ }{8: 1 }{13:^+-- 7 lines: common line··················}│{7:+ }{8: 1 }{13:+-- 7 lines: common line···················}|
+ {7: }{8: 8 }xyz │{7: }{8: 8 }xyz |
+ {7: }{8: 9 }DEFabc │{7: }{8: 9 }DEFabc |
+ {7: }{8: 10 }DEFabc │{7: }{8: 10 }DEFabc |
+ {7: }{8: 11 }DEFabc │{7: }{8: 11 }DEFabc |
+ {7: }{8: 12 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 13 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 14 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 15 }something │{7: }{8: 17 }something |
+ {7: }{8: 16 } │{7: }{8: 18 } |
+ {1:~ }│{1:~ }|*6
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:5,9diffget |
]])
end)
@@ -311,23 +288,23 @@ something
feed('2<c-w>w')
feed(':5,10diffget<cr>')
screen:expect([[
- {1:- }{10: 1 } │{1:- }{10: 1 }^ |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }ABCabc │{1: }{10: 5 }ABCabc |
- {1: }{10: 6 }ABCabc │{1: }{10: 6 }ABCabc |
- {1: }{10: 7 }ABCabc │{1: }{10: 7 }ABCabc |
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 8 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 9 }common line |
- {1: }{10: 10 }common line │{1: }{10: 10 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 11 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 12 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 13 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 14 }something |
- {1: }{10: 13 } │{1: }{10: 15 } |
- {6:~ }│{6:~ }|*3
- {3:Xtest-functional-diff-screen-1.2 }{7:Xtest-functional-diff-screen-1 [+] }|
+ {7:- }{8: 1 } │{7:- }{8: 1 }^ |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }ABCabc │{7: }{8: 5 }ABCabc |
+ {7: }{8: 6 }ABCabc │{7: }{8: 6 }ABCabc |
+ {7: }{8: 7 }ABCabc │{7: }{8: 7 }ABCabc |
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 8 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 9 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 10 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 11 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 12 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 13 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 14 }something |
+ {7: }{8: 13 } │{7: }{8: 15 } |
+ {1:~ }│{1:~ }|*3
+ {2:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
:5,10diffget |
]])
end)
@@ -335,21 +312,21 @@ something
feed('2<c-w>w')
feed(':4,17diffget<cr>')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 }^ |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }ABCabc │{1: }{10: 5 }ABCabc |
- {1: }{10: 6 }ABCabc │{1: }{10: 6 }ABCabc |
- {1: }{10: 7 }ABCabc │{1: }{10: 7 }ABCabc |
- {1: }{10: 8 }ABCabc │{1: }{10: 8 }ABCabc |
- {1: }{10: 9 }common line │{1: }{10: 9 }common line |
- {1: }{10: 10 }common line │{1: }{10: 10 }common line |
- {1: }{10: 11 }common line │{1: }{10: 11 }common line |
- {1: }{10: 12 }something │{1: }{10: 12 }something |
- {1: }{10: 13 } │{1: }{10: 13 } |
- {6:~ }│{6:~ }|*5
- {3:Xtest-functional-diff-screen-1.2 }{7:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 }^ |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }ABCabc │{7: }{8: 5 }ABCabc |
+ {7: }{8: 6 }ABCabc │{7: }{8: 6 }ABCabc |
+ {7: }{8: 7 }ABCabc │{7: }{8: 7 }ABCabc |
+ {7: }{8: 8 }ABCabc │{7: }{8: 8 }ABCabc |
+ {7: }{8: 9 }common line │{7: }{8: 9 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 10 }common line |
+ {7: }{8: 11 }common line │{7: }{8: 11 }common line |
+ {7: }{8: 12 }something │{7: }{8: 12 }something |
+ {7: }{8: 13 } │{7: }{8: 13 } |
+ {1:~ }│{1:~ }|*5
+ {2:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
:4,17diffget |
]])
end)
@@ -357,25 +334,25 @@ something
feed('1<c-w>w')
feed(':4,12diffget<cr>')
screen:expect([[
- {1: }{10: 1 }^ │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }DEFabc │{1: }{10: 5 }DEFabc |
- {1: }{10: 6 }xyz │{1: }{10: 6 }xyz |
- {1: }{10: 7 }xyz │{1: }{10: 7 }xyz |
- {1: }{10: 8 }xyz │{1: }{10: 8 }xyz |
- {1: }{10: 9 }DEFabc │{1: }{10: 9 }DEFabc |
- {1: }{10: 10 }DEFabc │{1: }{10: 10 }DEFabc |
- {1: }{10: 11 }DEFabc │{1: }{10: 11 }DEFabc |
- {1: }{10: 12 }common line │{1: }{10: 12 }common line |
- {1: }{10: 13 }common line │{1: }{10: 13 }common line |
- {1: }{10: 14 }DEF │{1: }{10: 14 }DEF |
- {1: }{10: 15 }common line │{1: }{10: 15 }common line |
- {1: }{10: 16 }DEF │{1: }{10: 16 }DEF |
- {1: }{10: 17 }something │{1: }{10: 17 }something |
- {1: }{10: 18 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }^ │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }DEFabc │{7: }{8: 5 }DEFabc |
+ {7: }{8: 6 }xyz │{7: }{8: 6 }xyz |
+ {7: }{8: 7 }xyz │{7: }{8: 7 }xyz |
+ {7: }{8: 8 }xyz │{7: }{8: 8 }xyz |
+ {7: }{8: 9 }DEFabc │{7: }{8: 9 }DEFabc |
+ {7: }{8: 10 }DEFabc │{7: }{8: 10 }DEFabc |
+ {7: }{8: 11 }DEFabc │{7: }{8: 11 }DEFabc |
+ {7: }{8: 12 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 13 }common line │{7: }{8: 13 }common line |
+ {7: }{8: 14 }DEF │{7: }{8: 14 }DEF |
+ {7: }{8: 15 }common line │{7: }{8: 15 }common line |
+ {7: }{8: 16 }DEF │{7: }{8: 16 }DEF |
+ {7: }{8: 17 }something │{7: }{8: 17 }something |
+ {7: }{8: 18 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:4,12diffget |
]])
end)
@@ -384,25 +361,25 @@ something
feed('5gg')
feed('do')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }^DEFabc │{1: }{10: 5 }DEFabc |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 7 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 17 }something |
- {1: }{10: 13 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }^DEFabc │{7: }{8: 5 }DEFabc |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 7 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 17 }something |
+ {7: }{8: 13 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -411,25 +388,25 @@ something
feed('6gg')
feed('do')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }^DEFabc │{1: }{10: 9 }DEFabc |
- {1: }{10: 7 }DEFabc │{1: }{10: 10 }DEFabc |
- {1: }{10: 8 }DEFabc │{1: }{10: 11 }DEFabc |
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 17 }something |
- {1: }{10: 13 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }^DEFabc │{7: }{8: 9 }DEFabc |
+ {7: }{8: 7 }DEFabc │{7: }{8: 10 }DEFabc |
+ {7: }{8: 8 }DEFabc │{7: }{8: 11 }DEFabc |
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 17 }something |
+ {7: }{8: 13 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -438,25 +415,25 @@ something
feed('7gg')
feed('do')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }DEFabc │{1: }{10: 9 }DEFabc |
- {1: }{10: 7 }^DEFabc │{1: }{10: 10 }DEFabc |
- {1: }{10: 8 }DEFabc │{1: }{10: 11 }DEFabc |
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 17 }something |
- {1: }{10: 13 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }DEFabc │{7: }{8: 9 }DEFabc |
+ {7: }{8: 7 }^DEFabc │{7: }{8: 10 }DEFabc |
+ {7: }{8: 8 }DEFabc │{7: }{8: 11 }DEFabc |
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 17 }something |
+ {7: }{8: 13 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -465,25 +442,25 @@ something
feed('11gg')
feed('do')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 7 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: 11 }DEF │{1: }{10: 14 }DEF |
- {1: }{10: 12 }^common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 13 }something │{1: }{10: 17 }something |
- {1: }{10: 14 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 7 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: 11 }DEF │{7: }{8: 14 }DEF |
+ {7: }{8: 12 }^common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 13 }something │{7: }{8: 17 }something |
+ {7: }{8: 14 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -492,25 +469,25 @@ something
feed('12gg')
feed('do')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 7 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: 12 }DEF │{1: }{10: 16 }DEF |
- {1: }{10: 13 }^something │{1: }{10: 17 }something |
- {1: }{10: 14 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 7 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: 12 }DEF │{7: }{8: 16 }DEF |
+ {7: }{8: 13 }^something │{7: }{8: 17 }something |
+ {7: }{8: 14 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -519,25 +496,25 @@ something
feed('5gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }^ABCabc │{1: }{10: 5 }ABCabc |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 7 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 17 }something |
- {1: }{10: 13 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }^ABCabc │{7: }{8: 5 }ABCabc |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 7 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 17 }something |
+ {7: }{8: 13 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 [+] }|
:e |
]])
end)
@@ -546,25 +523,25 @@ something
feed('6gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }^ABCabc │{1: }{10: 9 }ABCabc |
- {1: }{10: 7 }ABCabc │{1: }{10: 10 }ABCabc |
- {1: }{10: 8 }ABCabc │{1: }{10: 11 }ABCabc |
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 17 }something |
- {1: }{10: 13 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }^ABCabc │{7: }{8: 9 }ABCabc |
+ {7: }{8: 7 }ABCabc │{7: }{8: 10 }ABCabc |
+ {7: }{8: 8 }ABCabc │{7: }{8: 11 }ABCabc |
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 17 }something |
+ {7: }{8: 13 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 [+] }|
:e |
]])
end)
@@ -573,25 +550,25 @@ something
feed('7gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }ABCabc │{1: }{10: 9 }ABCabc |
- {1: }{10: 7 }^ABCabc │{1: }{10: 10 }ABCabc |
- {1: }{10: 8 }ABCabc │{1: }{10: 11 }ABCabc |
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 17 }something |
- {1: }{10: 13 } │{1: }{10: 18 } |
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }ABCabc │{7: }{8: 9 }ABCabc |
+ {7: }{8: 7 }^ABCabc │{7: }{8: 10 }ABCabc |
+ {7: }{8: 8 }ABCabc │{7: }{8: 11 }ABCabc |
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 17 }something |
+ {7: }{8: 13 } │{7: }{8: 18 } |
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 [+] }|
:e |
]])
end)
@@ -600,25 +577,25 @@ something
feed('11gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 7 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: 11 }^common line │{1: }{10: 14 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 15 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 16 }something |
- {1: }{10: 13 } │{1: }{10: 17 } |
- {6:~ }│{6:~ }|
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 7 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: 11 }^common line │{7: }{8: 14 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 15 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 16 }something |
+ {7: }{8: 13 } │{7: }{8: 17 } |
+ {1:~ }│{1:~ }|
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 [+] }|
:e |
]])
end)
@@ -627,25 +604,25 @@ something
feed('12gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 7 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: 12 }^something │{1: }{10: 16 }something |
- {1: }{10: 13 } │{1: }{10: 17 } |
- {6:~ }│{6:~ }|
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 7 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: 12 }^something │{7: }{8: 16 }something |
+ {7: }{8: 13 } │{7: }{8: 17 } |
+ {1:~ }│{1:~ }|
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 [+] }|
:e |
]])
end)
@@ -654,25 +631,25 @@ something
feed('6gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: 6 }xyz │{1: }{10: 6 }^xyz |
- {1: }{10: 7 }xyz │{1: }{10: 7 }xyz |
- {1: }{10: 8 }xyz │{1: }{10: 8 }xyz |
- {1: }{10: 9 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 10 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 11 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 12 }common line │{1: }{10: 12 }common line |
- {1: }{10: 13 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 14 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 15 }something │{1: }{10: 17 }something |
- {1: }{10: 16 } │{1: }{10: 18 } |
- {3:Xtest-functional-diff-screen-1.2 [+] }{7:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: 6 }xyz │{7: }{8: 6 }^xyz |
+ {7: }{8: 7 }xyz │{7: }{8: 7 }xyz |
+ {7: }{8: 8 }xyz │{7: }{8: 8 }xyz |
+ {7: }{8: 9 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 10 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 11 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 12 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 13 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 14 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 15 }something │{7: }{8: 17 }something |
+ {7: }{8: 16 } │{7: }{8: 18 } |
+ {2:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -681,25 +658,25 @@ something
feed('8gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: 6 }xyz │{1: }{10: 6 }xyz |
- {1: }{10: 7 }xyz │{1: }{10: 7 }xyz |
- {1: }{10: 8 }xyz │{1: }{10: 8 }^xyz |
- {1: }{10: 9 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 10 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 11 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 12 }common line │{1: }{10: 12 }common line |
- {1: }{10: 13 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 14 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 15 }something │{1: }{10: 17 }something |
- {1: }{10: 16 } │{1: }{10: 18 } |
- {3:Xtest-functional-diff-screen-1.2 [+] }{7:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: 6 }xyz │{7: }{8: 6 }xyz |
+ {7: }{8: 7 }xyz │{7: }{8: 7 }xyz |
+ {7: }{8: 8 }xyz │{7: }{8: 8 }^xyz |
+ {7: }{8: 9 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 10 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 11 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 12 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 13 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 14 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 15 }something │{7: }{8: 17 }something |
+ {7: }{8: 16 } │{7: }{8: 18 } |
+ {2:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -708,25 +685,25 @@ something
feed('9gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }DEFabc │{1: }{10: 9 }^DEFabc |
- {1: }{10: 7 }DEFabc │{1: }{10: 10 }DEFabc |
- {1: }{10: 8 }DEFabc │{1: }{10: 11 }DEFabc |
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 16 }{4:DEF }|
- {1: }{10: 12 }something │{1: }{10: 17 }something |
- {1: }{10: 13 } │{1: }{10: 18 } |
- {3:Xtest-functional-diff-screen-1.2 [+] }{7:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }DEFabc │{7: }{8: 9 }^DEFabc |
+ {7: }{8: 7 }DEFabc │{7: }{8: 10 }DEFabc |
+ {7: }{8: 8 }DEFabc │{7: }{8: 11 }DEFabc |
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 16 }{22:DEF }|
+ {7: }{8: 12 }something │{7: }{8: 17 }something |
+ {7: }{8: 13 } │{7: }{8: 18 } |
+ {2:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -735,25 +712,25 @@ something
feed('17gg')
feed('dp')
screen:expect([[
- {1: }{10: 1 } │{1: }{10: 1 } |
- {1: }{10: 2 }common line │{1: }{10: 2 }common line |
- {1: }{10: 3 }common line │{1: }{10: 3 }common line |
- {1: }{10: 4 } │{1: }{10: 4 } |
- {1: }{10: 5 }{8:ABC}{9:abc }│{1: }{10: 5 }{8:DEF}{9:abc }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 6 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 7 }{4:xyz }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 8 }{4:xyz }|
- {1: }{10: 6 }{8:ABC}{9:abc }│{1: }{10: 9 }{8:DEF}{9:abc }|
- {1: }{10: 7 }{8:ABC}{9:abc }│{1: }{10: 10 }{8:DEF}{9:abc }|
- {1: }{10: 8 }{8:ABC}{9:abc }│{1: }{10: 11 }{8:DEF}{9:abc }|
- {1: }{10: 9 }common line │{1: }{10: 12 }common line |
- {1: }{10: 10 }common line │{1: }{10: 13 }common line |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 14 }{4:DEF }|
- {1: }{10: 11 }common line │{1: }{10: 15 }common line |
- {1: }{10: 12 }DEF │{1: }{10: 16 }DEF |
- {1: }{10: 13 }something │{1: }{10: 17 }^something |
- {1: }{10: 14 } │{1: }{10: 18 } |
- {3:Xtest-functional-diff-screen-1.2 [+] }{7:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 } │{7: }{8: 1 } |
+ {7: }{8: 2 }common line │{7: }{8: 2 }common line |
+ {7: }{8: 3 }common line │{7: }{8: 3 }common line |
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {7: }{8: 5 }{27:ABC}{4:abc }│{7: }{8: 5 }{27:DEF}{4:abc }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 6 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 7 }{22:xyz }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 8 }{22:xyz }|
+ {7: }{8: 6 }{27:ABC}{4:abc }│{7: }{8: 9 }{27:DEF}{4:abc }|
+ {7: }{8: 7 }{27:ABC}{4:abc }│{7: }{8: 10 }{27:DEF}{4:abc }|
+ {7: }{8: 8 }{27:ABC}{4:abc }│{7: }{8: 11 }{27:DEF}{4:abc }|
+ {7: }{8: 9 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 10 }common line │{7: }{8: 13 }common line |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 14 }{22:DEF }|
+ {7: }{8: 11 }common line │{7: }{8: 15 }common line |
+ {7: }{8: 12 }DEF │{7: }{8: 16 }DEF |
+ {7: }{8: 13 }something │{7: }{8: 17 }^something |
+ {7: }{8: 14 } │{7: }{8: 18 } |
+ {2:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -778,13 +755,13 @@ d
it('display results', function()
screen:expect([[
- {1: }{10: 1 }{4:^ }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 2 }{9:abc d }│{1: }{10: 1 }{8:// }{9:abc d }|
- {1: }{10: 3 }{9:d }│{1: }{10: 2 }{8:// }{9:d }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 3 }{4:// d }|
- {1: }{10: 4 } │{1: }{10: 4 } |
- {6:~ }│{6:~ }|*13
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }{22:^ }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 2 }{4:abc d }│{7: }{8: 1 }{27:// }{4:abc d }|
+ {7: }{8: 3 }{4:d }│{7: }{8: 2 }{27:// }{4:d }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 3 }{22:// d }|
+ {7: }{8: 4 } │{7: }{8: 4 } |
+ {1:~ }│{1:~ }|*13
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -813,15 +790,15 @@ void testFunction () {
it('display results', function()
screen:expect([[
- {1: }{10: 1 }^void testFunction () { │{1: }{10: 1 }void testFunction () { |
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 2 }{4: for (int i = 0; i < 10; i++) { }|
- {1: }{10: 2 }{9: }{8:// for (int j = 0; j < 10; i}{9:++) { }│{1: }{10: 3 }{9: }{8:for (int j = 0; j < 10; j}{9:++) { }|
- {1: }{10: 3 }{9: }{8:// }{9:} }│{1: }{10: 4 }{9: } }|
- {1: }{10: }{2:-------------------------------------------}│{1: }{10: 5 }{4: } }|
- {1: }{10: 4 }} │{1: }{10: 6 }} |
- {1: }{10: 5 } │{1: }{10: 7 } |
- {6:~ }│{6:~ }|*11
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }^void testFunction () { │{7: }{8: 1 }void testFunction () { |
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 2 }{22: for (int i = 0; i < 10; i++) { }|
+ {7: }{8: 2 }{4: }{27:// for (int j = 0; j < 10; i}{4:++) { }│{7: }{8: 3 }{4: }{27:for (int j = 0; j < 10; j}{4:++) { }|
+ {7: }{8: 3 }{4: }{27:// }{4:} }│{7: }{8: 4 }{4: } }|
+ {7: }{8: }{23:-------------------------------------------}│{7: }{8: 5 }{22: } }|
+ {7: }{8: 4 }} │{7: }{8: 6 }} |
+ {7: }{8: 5 } │{7: }{8: 7 } |
+ {1:~ }│{1:~ }|*11
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -851,17 +828,17 @@ void testFunction () {
it('display results', function()
screen:expect([[
- {1: }{10: 1 }{4:^?Z }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 2 }{8:?}{9:A }│{1: }{10: 1 }{8:!}{9:A }|
- {1: }{10: 3 }{8:?}{9:B }│{1: }{10: 2 }{8:!}{9:B }|
- {1: }{10: 4 }{8:?}{9:C }│{1: }{10: 3 }{8:!}{9:C }|
- {1: }{10: 5 }{4:?A }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 6 }{4:?B }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 7 }{4:?B }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 8 }{4:?C }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 9 } │{1: }{10: 4 } |
- {6:~ }│{6:~ }|*9
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }{22:^?Z }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 2 }{27:?}{4:A }│{7: }{8: 1 }{27:!}{4:A }|
+ {7: }{8: 3 }{27:?}{4:B }│{7: }{8: 2 }{27:!}{4:B }|
+ {7: }{8: 4 }{27:?}{4:C }│{7: }{8: 3 }{27:!}{4:C }|
+ {7: }{8: 5 }{22:?A }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 6 }{22:?B }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 7 }{22:?B }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 8 }{22:?C }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 9 } │{7: }{8: 4 } |
+ {1:~ }│{1:~ }|*9
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -891,17 +868,17 @@ void testFunction () {
it('display results', function()
screen:expect([[
- {1: }{10: 1 }{4:^?A }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 2 }{4:?Z }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 3 }{4:?B }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 4 }{4:?C }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 5 }{8:?}{9:A }│{1: }{10: 1 }{8:!}{9:A }|
- {1: }{10: 6 }{8:?}{9:B }│{1: }{10: 2 }{8:!}{9:B }|
- {1: }{10: 7 }{8:?}{9:C }│{1: }{10: 3 }{8:!}{9:C }|
- {1: }{10: 8 }{4:?C }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 9 } │{1: }{10: 4 } |
- {6:~ }│{6:~ }|*9
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }{22:^?A }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 2 }{22:?Z }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 3 }{22:?B }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 4 }{22:?C }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 5 }{27:?}{4:A }│{7: }{8: 1 }{27:!}{4:A }|
+ {7: }{8: 6 }{27:?}{4:B }│{7: }{8: 2 }{27:!}{4:B }|
+ {7: }{8: 7 }{27:?}{4:C }│{7: }{8: 3 }{27:!}{4:C }|
+ {7: }{8: 8 }{22:?C }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 9 } │{7: }{8: 4 } |
+ {1:~ }│{1:~ }|*9
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
end)
@@ -953,50 +930,50 @@ something
feed('1<c-w>w')
-- linematch is disabled for the longest diff because it's combined line length is over 10
screen:expect([[
- {1: }{10: 1 }^common line │{1: }{10: 1 }common line |
- {1: }{10: 2 }{4:DEF }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 3 }{8:GHI}{9: }│{1: }{10: 2 }{8:HIL}{9: }|
- {1: }{10: 4 }{4:something }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 5 } │{1: }{10: 3 } |
- {1: }{10: 6 }{9:a}{8:DEF}{9:abc }│{1: }{10: 4 }{9:a}{8:ABC}{9:abc }|
- {1: }{10: 7 }{8:xyz}{9: }│{1: }{10: 5 }{8:aABCabc}{9: }|
- {1: }{10: 8 }{8:xyz}{9: }│{1: }{10: 6 }{8:aABCabc}{9: }|
- {1: }{10: 9 }{8:xyz}{9: }│{1: }{10: 7 }{8:aABCabc}{9: }|
- {1: }{10: 10 }{4:aDEFabc }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 11 }{4:aDEFabc }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 12 }{4:aDEFabc }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 13 }common line │{1: }{10: 8 }common line |
- {1: }{10: 14 }{4:DEF }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 15 }{8:GHI}{9: }│{1: }{10: 9 }{8:HIL}{9: }|
- {1: }{10: 16 }{4:something else }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 17 }common line │{1: }{10: 10 }common line |
- {1: }{10: 18 }something │{1: }{10: 11 }something |
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }^common line │{7: }{8: 1 }common line |
+ {7: }{8: 2 }{22:DEF }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 3 }{27:GHI}{4: }│{7: }{8: 2 }{27:HIL}{4: }|
+ {7: }{8: 4 }{22:something }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 5 } │{7: }{8: 3 } |
+ {7: }{8: 6 }{4:a}{27:DEF}{4:abc }│{7: }{8: 4 }{4:a}{27:ABC}{4:abc }|
+ {7: }{8: 7 }{27:xyz}{4: }│{7: }{8: 5 }{27:aABCabc}{4: }|
+ {7: }{8: 8 }{27:xyz}{4: }│{7: }{8: 6 }{27:aABCabc}{4: }|
+ {7: }{8: 9 }{27:xyz}{4: }│{7: }{8: 7 }{27:aABCabc}{4: }|
+ {7: }{8: 10 }{22:aDEFabc }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 11 }{22:aDEFabc }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 12 }{22:aDEFabc }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 13 }common line │{7: }{8: 8 }common line |
+ {7: }{8: 14 }{22:DEF }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 15 }{27:GHI}{4: }│{7: }{8: 9 }{27:HIL}{4: }|
+ {7: }{8: 16 }{22:something else }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 17 }common line │{7: }{8: 10 }common line |
+ {7: }{8: 18 }something │{7: }{8: 11 }something |
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 }|
:e |
]])
-- enable it by increasing the number
feed(':set diffopt-=linematch:10<cr>')
feed(':set diffopt+=linematch:30<cr>')
screen:expect([[
- {1: }{10: 1 }^common line │{1: }{10: 1 }common line |
- {1: }{10: 2 }{4:DEF }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 3 }{8:GHI}{9: }│{1: }{10: 2 }{8:HIL}{9: }|
- {1: }{10: 4 }{4:something }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 5 } │{1: }{10: 3 } |
- {1: }{10: 6 }{9:a}{8:DEF}{9:abc }│{1: }{10: 4 }{9:a}{8:ABC}{9:abc }|
- {1: }{10: 7 }{4:xyz }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 8 }{4:xyz }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 9 }{4:xyz }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 10 }{9:a}{8:DEF}{9:abc }│{1: }{10: 5 }{9:a}{8:ABC}{9:abc }|
- {1: }{10: 11 }{9:a}{8:DEF}{9:abc }│{1: }{10: 6 }{9:a}{8:ABC}{9:abc }|
- {1: }{10: 12 }{9:a}{8:DEF}{9:abc }│{1: }{10: 7 }{9:a}{8:ABC}{9:abc }|
- {1: }{10: 13 }common line │{1: }{10: 8 }common line |
- {1: }{10: 14 }{4:DEF }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 15 }{8:GHI}{9: }│{1: }{10: 9 }{8:HIL}{9: }|
- {1: }{10: 16 }{4:something else }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 17 }common line │{1: }{10: 10 }common line |
- {1: }{10: 18 }something │{1: }{10: 11 }something |
- {7:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }^common line │{7: }{8: 1 }common line |
+ {7: }{8: 2 }{22:DEF }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 3 }{27:GHI}{4: }│{7: }{8: 2 }{27:HIL}{4: }|
+ {7: }{8: 4 }{22:something }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 5 } │{7: }{8: 3 } |
+ {7: }{8: 6 }{4:a}{27:DEF}{4:abc }│{7: }{8: 4 }{4:a}{27:ABC}{4:abc }|
+ {7: }{8: 7 }{22:xyz }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 8 }{22:xyz }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 9 }{22:xyz }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 10 }{4:a}{27:DEF}{4:abc }│{7: }{8: 5 }{4:a}{27:ABC}{4:abc }|
+ {7: }{8: 11 }{4:a}{27:DEF}{4:abc }│{7: }{8: 6 }{4:a}{27:ABC}{4:abc }|
+ {7: }{8: 12 }{4:a}{27:DEF}{4:abc }│{7: }{8: 7 }{4:a}{27:ABC}{4:abc }|
+ {7: }{8: 13 }common line │{7: }{8: 8 }common line |
+ {7: }{8: 14 }{22:DEF }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 15 }{27:GHI}{4: }│{7: }{8: 9 }{27:HIL}{4: }|
+ {7: }{8: 16 }{22:something else }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 17 }common line │{7: }{8: 10 }common line |
+ {7: }{8: 18 }something │{7: }{8: 11 }something |
+ {3:Xtest-functional-diff-screen-1.2 }{2:Xtest-functional-diff-screen-1 }|
:set diffopt+=linematch:30 |
]])
end
@@ -1005,25 +982,25 @@ something
feed('2<c-w>w')
feed(':1,12diffget<cr>')
screen:expect([[
- {1: }{10: 1 }common line │{1: }{10: 1 }^common line |
- {1: }{10: 2 }DEF │{1: }{10: 2 }DEF |
- {1: }{10: 3 }GHI │{1: }{10: 3 }GHI |
- {1: }{10: 4 }something │{1: }{10: 4 }something |
- {1: }{10: 5 } │{1: }{10: 5 } |
- {1: }{10: 6 }aDEFabc │{1: }{10: 6 }aDEFabc |
- {1: }{10: 7 }xyz │{1: }{10: 7 }xyz |
- {1: }{10: 8 }xyz │{1: }{10: 8 }xyz |
- {1: }{10: 9 }xyz │{1: }{10: 9 }xyz |
- {1: }{10: 10 }aDEFabc │{1: }{10: 10 }aDEFabc |
- {1: }{10: 11 }aDEFabc │{1: }{10: 11 }aDEFabc |
- {1: }{10: 12 }aDEFabc │{1: }{10: 12 }aDEFabc |
- {1: }{10: 13 }common line │{1: }{10: 13 }common line |
- {1: }{10: 14 }DEF │{1: }{10: 14 }DEF |
- {1: }{10: 15 }GHI │{1: }{10: 15 }GHI |
- {1: }{10: 16 }something else │{1: }{10: 16 }something else |
- {1: }{10: 17 }common line │{1: }{10: 17 }common line |
- {1: }{10: 18 }something │{1: }{10: 18 }something |
- {3:Xtest-functional-diff-screen-1.2 }{7:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 }common line │{7: }{8: 1 }^common line |
+ {7: }{8: 2 }DEF │{7: }{8: 2 }DEF |
+ {7: }{8: 3 }GHI │{7: }{8: 3 }GHI |
+ {7: }{8: 4 }something │{7: }{8: 4 }something |
+ {7: }{8: 5 } │{7: }{8: 5 } |
+ {7: }{8: 6 }aDEFabc │{7: }{8: 6 }aDEFabc |
+ {7: }{8: 7 }xyz │{7: }{8: 7 }xyz |
+ {7: }{8: 8 }xyz │{7: }{8: 8 }xyz |
+ {7: }{8: 9 }xyz │{7: }{8: 9 }xyz |
+ {7: }{8: 10 }aDEFabc │{7: }{8: 10 }aDEFabc |
+ {7: }{8: 11 }aDEFabc │{7: }{8: 11 }aDEFabc |
+ {7: }{8: 12 }aDEFabc │{7: }{8: 12 }aDEFabc |
+ {7: }{8: 13 }common line │{7: }{8: 13 }common line |
+ {7: }{8: 14 }DEF │{7: }{8: 14 }DEF |
+ {7: }{8: 15 }GHI │{7: }{8: 15 }GHI |
+ {7: }{8: 16 }something else │{7: }{8: 16 }something else |
+ {7: }{8: 17 }common line │{7: }{8: 17 }common line |
+ {7: }{8: 18 }something │{7: }{8: 18 }something |
+ {2:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
:1,12diffget |
]])
end)
@@ -1031,20 +1008,20 @@ something
feed('1<c-w>w')
feed(':1,19diffget<cr>')
screen:expect([[
- {1: }{10: 1 }^common line │{1: }{10: 1 }common line |
- {1: }{10: 2 }HIL │{1: }{10: 2 }HIL |
- {1: }{10: 3 } │{1: }{10: 3 } |
- {1: }{10: 4 }aABCabc │{1: }{10: 4 }aABCabc |
- {1: }{10: 5 }aABCabc │{1: }{10: 5 }aABCabc |
- {1: }{10: 6 }aABCabc │{1: }{10: 6 }aABCabc |
- {1: }{10: 7 }aABCabc │{1: }{10: 7 }aABCabc |
- {1: }{10: 8 }common line │{1: }{10: 8 }common line |
- {1: }{10: 9 }HIL │{1: }{10: 9 }HIL |
- {1: }{10: 10 }common line │{1: }{10: 10 }common line |
- {1: }{10: 11 }something │{1: }{10: 11 }something |
- {1: }{10: 12 } │{1: }{10: 12 } |
- {6:~ }│{6:~ }|*6
- {7:Xtest-functional-diff-screen-1.2 [+] }{3:Xtest-functional-diff-screen-1 }|
+ {7: }{8: 1 }^common line │{7: }{8: 1 }common line |
+ {7: }{8: 2 }HIL │{7: }{8: 2 }HIL |
+ {7: }{8: 3 } │{7: }{8: 3 } |
+ {7: }{8: 4 }aABCabc │{7: }{8: 4 }aABCabc |
+ {7: }{8: 5 }aABCabc │{7: }{8: 5 }aABCabc |
+ {7: }{8: 6 }aABCabc │{7: }{8: 6 }aABCabc |
+ {7: }{8: 7 }aABCabc │{7: }{8: 7 }aABCabc |
+ {7: }{8: 8 }common line │{7: }{8: 8 }common line |
+ {7: }{8: 9 }HIL │{7: }{8: 9 }HIL |
+ {7: }{8: 10 }common line │{7: }{8: 10 }common line |
+ {7: }{8: 11 }something │{7: }{8: 11 }something |
+ {7: }{8: 12 } │{7: }{8: 12 } |
+ {1:~ }│{1:~ }|*6
+ {3:Xtest-functional-diff-screen-1.2 [+] }{2:Xtest-functional-diff-screen-1 }|
:1,19diffget |
]])
end)
@@ -1054,25 +1031,25 @@ something
feed('2<c-w>w')
feed(':7,8diffget<cr>')
screen:expect([[
- {1: }{10: 1 }common line │{1: }{10: 1 }^common line |
- {1: }{10: 2 }{4:DEF }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 3 }{8:GHI}{9: }│{1: }{10: 2 }{8:HIL}{9: }|
- {1: }{10: 4 }{4:something }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 5 } │{1: }{10: 3 } |
- {1: }{10: 6 }{9:a}{8:DEF}{9:abc }│{1: }{10: 4 }{9:a}{8:ABC}{9:abc }|
- {1: }{10: 7 }{8:xyz}{9: }│{1: }{10: 5 }{8:aABCabc}{9: }|
- {1: }{10: 8 }{8:xyz}{9: }│{1: }{10: 6 }{8:aABCabc}{9: }|
- {1: }{10: 9 }xyz │{1: }{10: 7 }xyz |
- {1: }{10: 10 }aDEFabc │{1: }{10: 8 }aDEFabc |
- {1: }{10: 11 }aDEFabc │{1: }{10: 9 }aDEFabc |
- {1: }{10: 12 }aDEFabc │{1: }{10: 10 }aDEFabc |
- {1: }{10: 13 }common line │{1: }{10: 11 }common line |
- {1: }{10: 14 }{4:DEF }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 15 }{8:GHI}{9: }│{1: }{10: 12 }{8:HIL}{9: }|
- {1: }{10: 16 }{4:something else }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 17 }common line │{1: }{10: 13 }common line |
- {1: }{10: 18 }something │{1: }{10: 14 }something |
- {3:Xtest-functional-diff-screen-1.2 }{7:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 }common line │{7: }{8: 1 }^common line |
+ {7: }{8: 2 }{22:DEF }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 3 }{27:GHI}{4: }│{7: }{8: 2 }{27:HIL}{4: }|
+ {7: }{8: 4 }{22:something }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 5 } │{7: }{8: 3 } |
+ {7: }{8: 6 }{4:a}{27:DEF}{4:abc }│{7: }{8: 4 }{4:a}{27:ABC}{4:abc }|
+ {7: }{8: 7 }{27:xyz}{4: }│{7: }{8: 5 }{27:aABCabc}{4: }|
+ {7: }{8: 8 }{27:xyz}{4: }│{7: }{8: 6 }{27:aABCabc}{4: }|
+ {7: }{8: 9 }xyz │{7: }{8: 7 }xyz |
+ {7: }{8: 10 }aDEFabc │{7: }{8: 8 }aDEFabc |
+ {7: }{8: 11 }aDEFabc │{7: }{8: 9 }aDEFabc |
+ {7: }{8: 12 }aDEFabc │{7: }{8: 10 }aDEFabc |
+ {7: }{8: 13 }common line │{7: }{8: 11 }common line |
+ {7: }{8: 14 }{22:DEF }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 15 }{27:GHI}{4: }│{7: }{8: 12 }{27:HIL}{4: }|
+ {7: }{8: 16 }{22:something else }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 17 }common line │{7: }{8: 13 }common line |
+ {7: }{8: 18 }something │{7: }{8: 14 }something |
+ {2:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
:7,8diffget |
]])
end
@@ -1083,25 +1060,25 @@ something
feed('2<c-w>w')
feed(':8,10diffget<cr>')
screen:expect([[
- {1: }{10: 1 }common line │{1: }{10: 1 }^common line |
- {1: }{10: 2 }{4:DEF }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 3 }{8:GHI}{9: }│{1: }{10: 2 }{8:HIL}{9: }|
- {1: }{10: 4 }{4:something }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 5 } │{1: }{10: 3 } |
- {1: }{10: 6 }{9:a}{8:DEF}{9:abc }│{1: }{10: 4 }{9:a}{8:ABC}{9:abc }|
- {1: }{10: 7 }{8:xyz}{9: }│{1: }{10: 5 }{8:aABCabc}{9: }|
- {1: }{10: 8 }{8:xyz}{9: }│{1: }{10: 6 }{8:aABCabc}{9: }|
- {1: }{10: 9 }{8:xyz}{9: }│{1: }{10: 7 }{8:aABCabc}{9: }|
- {1: }{10: 10 }{4:aDEFabc }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 11 }{4:aDEFabc }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 12 }{4:aDEFabc }│{1: }{10: }{2:--------------------------------------------}|
- {1: }{10: 13 }common line │{1: }{10: 8 }common line |
- {1: }{10: 14 }DEF │{1: }{10: 9 }DEF |
- {1: }{10: 15 }GHI │{1: }{10: 10 }GHI |
- {1: }{10: 16 }something else │{1: }{10: 11 }something else |
- {1: }{10: 17 }common line │{1: }{10: 12 }common line |
- {1: }{10: 18 }something │{1: }{10: 13 }something |
- {3:Xtest-functional-diff-screen-1.2 }{7:Xtest-functional-diff-screen-1 [+] }|
+ {7: }{8: 1 }common line │{7: }{8: 1 }^common line |
+ {7: }{8: 2 }{22:DEF }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 3 }{27:GHI}{4: }│{7: }{8: 2 }{27:HIL}{4: }|
+ {7: }{8: 4 }{22:something }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 5 } │{7: }{8: 3 } |
+ {7: }{8: 6 }{4:a}{27:DEF}{4:abc }│{7: }{8: 4 }{4:a}{27:ABC}{4:abc }|
+ {7: }{8: 7 }{27:xyz}{4: }│{7: }{8: 5 }{27:aABCabc}{4: }|
+ {7: }{8: 8 }{27:xyz}{4: }│{7: }{8: 6 }{27:aABCabc}{4: }|
+ {7: }{8: 9 }{27:xyz}{4: }│{7: }{8: 7 }{27:aABCabc}{4: }|
+ {7: }{8: 10 }{22:aDEFabc }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 11 }{22:aDEFabc }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 12 }{22:aDEFabc }│{7: }{8: }{23:--------------------------------------------}|
+ {7: }{8: 13 }common line │{7: }{8: 8 }common line |
+ {7: }{8: 14 }DEF │{7: }{8: 9 }DEF |
+ {7: }{8: 15 }GHI │{7: }{8: 10 }GHI |
+ {7: }{8: 16 }something else │{7: }{8: 11 }something else |
+ {7: }{8: 17 }common line │{7: }{8: 12 }common line |
+ {7: }{8: 18 }something │{7: }{8: 13 }something |
+ {2:Xtest-functional-diff-screen-1.2 }{3:Xtest-functional-diff-screen-1 [+] }|
:8,10diffget |
]])
end
@@ -1118,10 +1095,10 @@ describe('regressions', function()
screen = Screen.new(100, 20)
screen:attach()
-- line must be greater than MATCH_CHAR_MAX_LEN
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1000) .. 'hello' })
- helpers.exec 'vnew'
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1010) .. 'world' })
- helpers.exec 'windo diffthis'
+ n.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1000) .. 'hello' })
+ n.exec 'vnew'
+ n.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1010) .. 'world' })
+ n.exec 'windo diffthis'
end)
it('properly computes filler lines for hunks bigger than linematch limit', function()
@@ -1133,10 +1110,10 @@ describe('regressions', function()
for i = 0, 29 do
lines[#lines + 1] = tostring(i)
end
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, lines)
- helpers.exec 'vnew'
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, { '00', '29' })
- helpers.exec 'windo diffthis'
+ n.api.nvim_buf_set_lines(0, 0, -1, false, lines)
+ n.exec 'vnew'
+ n.api.nvim_buf_set_lines(0, 0, -1, false, { '00', '29' })
+ n.exec 'windo diffthis'
feed('<C-e>')
screen:expect {
grid = [[
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 31b1464589..ca52a265fa 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1,24 +1,28 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed = helpers.clear, helpers.feed
-local eval = helpers.eval
-local eq = helpers.eq
-local command = helpers.command
-local set_method_error = helpers.set_method_error
-local api = helpers.api
-local async_meths = helpers.async_meths
-local test_build_dir = helpers.paths.test_build_dir
-local nvim_prog = helpers.nvim_prog
-local exec = helpers.exec
-local exec_capture = helpers.exec_capture
-local exc_exec = helpers.exc_exec
-local exec_lua = helpers.exec_lua
-local poke_eventloop = helpers.poke_eventloop
-local assert_alive = helpers.assert_alive
-local is_os = helpers.is_os
-local is_ci = helpers.is_ci
-local fn = helpers.fn
-local skip = helpers.skip
+
+local clear, feed = n.clear, n.feed
+local eval = n.eval
+local eq = t.eq
+local neq = t.neq
+local command = n.command
+local set_method_error = n.set_method_error
+local api = n.api
+local async_meths = n.async_meths
+local test_build_dir = t.paths.test_build_dir
+local nvim_prog = n.nvim_prog
+local testprg = n.testprg
+local exec = n.exec
+local exec_capture = n.exec_capture
+local exc_exec = n.exc_exec
+local exec_lua = n.exec_lua
+local poke_eventloop = n.poke_eventloop
+local assert_alive = n.assert_alive
+local retry = t.retry
+local is_os = t.is_os
+local fn = n.fn
+local skip = t.skip
describe('ui/ext_messages', function()
local screen
@@ -28,18 +32,9 @@ describe('ui/ext_messages', function()
clear()
screen = Screen.new(25, 5)
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, reverse = true },
- [7] = { background = Screen.colors.Yellow },
- [8] = { foreground = Screen.colors.Red },
- [9] = { special = Screen.colors.Red, undercurl = true },
- [10] = { foreground = Screen.colors.Brown },
- })
+ screen:add_extra_attr_ids {
+ [100] = { undercurl = true, special = Screen.colors.Red },
+ }
end)
after_each(function()
os.remove(fname)
@@ -55,7 +50,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { '\ntest\n[O]k: ', 4 } },
+ content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm',
},
},
@@ -83,7 +78,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { '\ntest\n[O]k: ', 4 } },
+ content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm',
},
},
@@ -97,7 +92,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { '\ntest\n[O]k: ', 4 } },
+ content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm',
},
{
@@ -105,7 +100,7 @@ describe('ui/ext_messages', function()
kind = 'echo',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -116,23 +111,13 @@ describe('ui/ext_messages', function()
feed(':%s/i/X/gc<cr>')
screen:expect {
grid = [[
- l{7:i}ne 1 |
- l{8:i}ne ^2 |
+ l{2:i}ne 1 |
+ l{10:i}ne ^2 |
{1:~ }|*3
]],
- attr_ids = {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, reverse = true },
- [7] = { reverse = true },
- [8] = { background = Screen.colors.Yellow },
- },
messages = {
{
- content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 4 } },
+ content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 6 } },
kind = 'confirm_sub',
},
},
@@ -146,16 +131,12 @@ describe('ui/ext_messages', function()
screen:expect {
grid = [[
line 1 |
- {MATCH:.*}|
+ line ^2 |
{1:~ }|*3
]],
- attr_ids = {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [7] = { foreground = Screen.colors.Red },
- },
messages = {
{
- content = { { 'W10: Warning: Changing a readonly file', 7 } },
+ content = { { 'W10: Warning: Changing a readonly file', 19 } },
kind = 'wmsg',
},
},
@@ -169,18 +150,9 @@ describe('ui/ext_messages', function()
line 2 |
{1:~ }|*3
]],
- attr_ids = {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, reverse = true },
- [7] = { foreground = Screen.colors.Red },
- },
messages = {
{
- content = { { 'search hit BOTTOM, continuing at TOP', 7 } },
+ content = { { 'search hit BOTTOM, continuing at TOP', 19 } },
kind = 'wmsg',
},
},
@@ -196,15 +168,15 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'Error detected while processing :', 2 } },
+ content = { { 'Error detected while processing :', 9 } },
kind = 'emsg',
},
{
- content = { { 'E605: Exception not caught: foo', 2 } },
+ content = { { 'E605: Exception not caught: foo', 9 } },
kind = '',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -237,7 +209,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'raa', 2 } },
+ content = { { 'raa', 9 } },
kind = 'echoerr',
} },
}
@@ -264,15 +236,15 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'bork', 2 } },
+ content = { { 'bork', 9 } },
kind = 'echoerr',
},
{
- content = { { 'fail', 2 } },
+ content = { { 'fail', 9 } },
kind = 'echoerr',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -286,19 +258,19 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'bork', 2 } },
+ content = { { 'bork', 9 } },
kind = 'echoerr',
},
{
- content = { { 'fail', 2 } },
+ content = { { 'fail', 9 } },
kind = 'echoerr',
},
{
- content = { { 'extrafail', 2 } },
+ content = { { 'extrafail', 9 } },
kind = 'echoerr',
},
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -320,7 +292,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'problem', 2 } },
+ content = { { 'problem', 9 } },
kind = 'echoerr',
} },
cmdline = {
@@ -348,15 +320,15 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
msg_history = {
- { kind = 'echoerr', content = { { 'raa', 2 } } },
- { kind = 'echoerr', content = { { 'bork', 2 } } },
- { kind = 'echoerr', content = { { 'fail', 2 } } },
- { kind = 'echoerr', content = { { 'extrafail', 2 } } },
- { kind = 'echoerr', content = { { 'problem', 2 } } },
+ { kind = 'echoerr', content = { { 'raa', 9 } } },
+ { kind = 'echoerr', content = { { 'bork', 9 } } },
+ { kind = 'echoerr', content = { { 'fail', 9 } } },
+ { kind = 'echoerr', content = { { 'extrafail', 9 } } },
+ { kind = 'echoerr', content = { { 'problem', 9 } } },
},
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -380,7 +352,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'bork\nfail', 2 } },
+ content = { { 'bork\nfail', 9 } },
kind = 'echoerr',
} },
}
@@ -393,13 +365,13 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
msg_history = {
{
- content = { { 'bork\nfail', 2 } },
+ content = { { 'bork\nfail', 9 } },
kind = 'echoerr',
},
},
@@ -413,8 +385,8 @@ describe('ui/ext_messages', function()
feed('/line<cr>')
screen:expect {
grid = [[
- {7:^line} 1 |
- {7:line} 2 |
+ {10:^line} 1 |
+ {10:line} 2 |
{1:~ }|*3
]],
messages = {
@@ -425,8 +397,8 @@ describe('ui/ext_messages', function()
feed('n')
screen:expect {
grid = [[
- {7:line} 1 |
- {7:^line} 2 |
+ {10:line} 1 |
+ {10:^line} 2 |
{1:~ }|*3
]],
messages = {
@@ -446,15 +418,15 @@ describe('ui/ext_messages', function()
{
content = {
{ '\nErrorMsg ' },
- { 'xxx', 2 },
+ { 'xxx', 9 },
{ ' ' },
- { 'ctermfg=', 5 },
+ { 'ctermfg=', 18 },
{ '15 ' },
- { 'ctermbg=', 5 },
+ { 'ctermbg=', 18 },
{ '1 ' },
- { 'guifg=', 5 },
+ { 'guifg=', 18 },
{ 'White ' },
- { 'guibg=', 5 },
+ { 'guibg=', 18 },
{ 'Red' },
},
kind = '',
@@ -474,7 +446,7 @@ describe('ui/ext_messages', function()
messages = {
{ content = { { 'x #1' } }, kind = '' },
{ content = { { 'y #2' } }, kind = '' },
- { content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' },
+ { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
},
}
end)
@@ -487,7 +459,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { '-- INSERT --', 3 } },
+ showmode = { { '-- INSERT --', 5 } },
}
feed('alphpabet<cr>alphanum<cr>')
@@ -498,7 +470,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*2
]],
- showmode = { { '-- INSERT --', 3 } },
+ showmode = { { '-- INSERT --', 5 } },
}
feed('<c-x>')
@@ -509,7 +481,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*2
]],
- showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 3 } },
+ showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 5 } },
}
feed('<c-p>')
@@ -525,7 +497,7 @@ describe('ui/ext_messages', function()
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
pos = 1,
},
- showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 1 of 2', 4 } },
+ showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
}
-- echomsg and showmode don't overwrite each other, this is the same
@@ -547,7 +519,7 @@ describe('ui/ext_messages', function()
content = { { 'stuff' } },
kind = 'echomsg',
} },
- showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 1 of 2', 4 } },
+ showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
}
feed('<c-p>')
@@ -567,7 +539,7 @@ describe('ui/ext_messages', function()
content = { { 'stuff' } },
kind = 'echomsg',
} },
- showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 2 of 2', 4 } },
+ showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 2 of 2', 6 } },
}
feed('<esc>:messages<cr>')
@@ -584,7 +556,7 @@ describe('ui/ext_messages', function()
} },
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
@@ -598,7 +570,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
}
feed('i')
@@ -607,7 +579,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { '-- INSERT --recording @q', 3 } },
+ showmode = { { '-- INSERT --recording @q', 5 } },
}
feed('<esc>')
@@ -616,7 +588,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
}
feed('q')
@@ -635,7 +607,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
mode = 'normal',
}
@@ -645,7 +617,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
mode = 'insert',
}
@@ -655,7 +627,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { 'recording @q', 3 } },
+ showmode = { { 'recording @q', 5 } },
mode = 'normal',
}
@@ -684,7 +656,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- showmode = { { '-- INSERT --', 3 } },
+ showmode = { { '-- INSERT --', 5 } },
ruler = { { '0,1 All' } },
}
feed('abcde<cr>12345<esc>')
@@ -715,7 +687,18 @@ describe('ui/ext_messages', function()
]],
ruler = { { '2,1 All' } },
}
- feed('d')
+ feed('<c-v>k2l')
+ screen:expect({
+ grid = [[
+ {17:ab}^cde |
+ {17:123}45 |
+ {1:~ }|*3
+ ]],
+ showmode = { { '-- VISUAL BLOCK --', 5 } },
+ showcmd = { { '2x3' } },
+ ruler = { { '1,3 All' } },
+ })
+ feed('o<esc>d')
screen:expect {
grid = [[
abcde |
@@ -752,7 +735,7 @@ describe('ui/ext_messages', function()
abcde |
^ |
{1:~ }|*2
- {6:<o Name] [+] 2,0-1 All}|
+ {3:<o Name] [+] 2,0-1 All}|
]])
end)
@@ -792,7 +775,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4
]],
messages = { {
- content = { { 'bork', 2 } },
+ content = { { 'bork', 9 } },
kind = 'echoerr',
} },
}
@@ -817,7 +800,7 @@ describe('ui/ext_messages', function()
]],
messages = {
{
- content = { { 'E117: Unknown function: nosuchfunction', 2 } },
+ content = { { 'E117: Unknown function: nosuchfunction', 9 } },
kind = 'emsg',
},
},
@@ -832,19 +815,19 @@ describe('ui/ext_messages', function()
msg_history = {
{ kind = 'echomsg', content = { { 'howdy' } } },
{ kind = '', content = { { 'Type :qa and press <Enter> to exit Nvim' } } },
- { kind = 'echoerr', content = { { 'bork', 2 } } },
- { kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 2 } } },
+ { kind = 'echoerr', content = { { 'bork', 9 } } },
+ { kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 9 } } },
},
messages = {
{
- content = { { 'Press ENTER or type command to continue', 4 } },
+ content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt',
},
},
}
end)
- it('implies ext_cmdline and ignores cmdheight', function()
+ it("implies ext_cmdline but allows changing 'cmdheight'", function()
eq(0, eval('&cmdheight'))
feed(':set cmdheight=1')
screen:expect {
@@ -864,15 +847,17 @@ describe('ui/ext_messages', function()
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|*4
+ {1:~ }|*3
+ |
]])
- eq(0, eval('&cmdheight'))
+ eq(1, eval('&cmdheight'))
feed(':set cmdheight=0')
screen:expect {
grid = [[
^ |
- {1:~ }|*4
+ {1:~ }|*3
+ |
]],
cmdline = {
{
@@ -907,7 +892,7 @@ error
stack traceback:
[C]: in function 'error'
[string ":lua"]:1: in main chunk]],
- 2,
+ 9,
},
},
kind = 'lua_error',
@@ -927,7 +912,7 @@ stack traceback:
messages = {
{
content = {
- { "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 2 },
+ { "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 9 },
},
kind = 'rpc_error',
},
@@ -952,7 +937,7 @@ stack traceback:
{
content = {
{ '\nn Q @@\nn Y y$\nn j ' },
- { '*', 5 },
+ { '*', 18 },
{ ' k' },
},
kind = '',
@@ -993,7 +978,7 @@ stack traceback:
feed('z=')
screen:expect {
grid = [[
- {9:helllo} |
+ {100:helllo} |
{1:~ }|*3
{1:^~ }|
]],
@@ -1012,7 +997,7 @@ stack traceback:
feed('1')
screen:expect {
grid = [[
- {9:helllo} |
+ {100:helllo} |
{1:~ }|*3
{1:^~ }|
]],
@@ -1050,7 +1035,7 @@ stack traceback:
{1:~ }|*4
]],
messages = {
- { content = { { 'wow, ', 7 }, { 'such\n\nvery ', 2 }, { 'color', 10 } }, kind = 'echomsg' },
+ { content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
},
}
@@ -1072,10 +1057,10 @@ stack traceback:
{1:~ }|*4
]],
messages = {
- { content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' },
+ { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
},
msg_history = {
- { content = { { 'wow, ', 7 }, { 'such\n\nvery ', 2 }, { 'color', 10 } }, kind = 'echomsg' },
+ { content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
},
}
@@ -1104,18 +1089,10 @@ describe('ui/builtin messages', function()
clear()
screen = Screen.new(60, 7)
screen:attach({ rgb = true, ext_popupmenu = true })
- screen:set_default_attr_ids {
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true, reverse = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { bold = true, foreground = Screen.colors.Magenta },
- [7] = { background = Screen.colors.Grey20 },
- [8] = { reverse = true },
- [9] = { background = Screen.colors.LightRed },
- [10] = { background = Screen.colors.Yellow },
- [11] = { foreground = Screen.colors.Brown },
+ screen:add_extra_attr_ids {
+ [100] = { background = Screen.colors.LightRed },
+ [101] = { background = Screen.colors.Grey20 },
+ [102] = { foreground = Screen.colors.Magenta1, bold = true },
}
end)
@@ -1125,12 +1102,12 @@ describe('ui/builtin messages', function()
screen:expect {
grid = [[
{3: }|
- {2:Error invoking 'test_method' on channel 1:} |
- {2:complete} |
- {2:error} |
+ {9:Error invoking 'test_method' on channel 1:} |
+ {9:complete} |
+ {9:error} |
|
- {2:message} |
- {4:Press ENTER or type command to continue}^ |
+ {9:message} |
+ {6:Press ENTER or type command to continue}^ |
]],
request_cb = function(name)
if name == 'test_method' then
@@ -1148,8 +1125,8 @@ describe('ui/builtin messages', function()
{1:~ }|*2
{3: }|
:hi ErrorMsg |
- ErrorMsg {2:xxx} {5:ctermfg=}15 {5:ctermbg=}1 {5:guifg=}White {5:guibg=}Red |
- {4:Press ENTER or type command to continue}^ |
+ ErrorMsg {9:xxx} {18:ctermfg=}15 {18:ctermbg=}1 {18:guifg=}White {18:guibg=}Red |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@@ -1157,12 +1134,12 @@ describe('ui/builtin messages', function()
feed(':hi ErrorMsg<cr>')
screen:expect([[
:hi ErrorMsg |
- ErrorMsg {2:xxx} {5:ctermfg=}15 |
- {5:ctermbg=}1 |
- {5:guifg=}White|
- {5:guibg=}Red |
- {4:Press ENTER or type command to}|
- {4: continue}^ |
+ ErrorMsg {9:xxx} {18:ctermfg=}15 |
+ {18:ctermbg=}1 |
+ {18:guifg=}White|
+ {18:guibg=}Red |
+ {6:Press ENTER or type command to}|
+ {6: continue}^ |
]])
feed('<cr>')
@@ -1176,13 +1153,13 @@ describe('ui/builtin messages', function()
screen:try_resize(110, 7)
feed(':syntax list vimComment<cr>')
screen:expect([[
- {6:--- Syntax items ---} |
- vimComment {5:xxx} {5:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {5:excludenl} {5:contains}=@vimCommentGroup,vimCommentString |
+ {102:--- Syntax items ---} |
+ vimComment {18:xxx} {18:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {18:excludenl} {18:contains}=@vimCommentGroup,vimCommentString |
|
- {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 {5:contains}=@vimCommentGroup,vimCommentString |
- {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:contains}=@vimCommentGroup,vimCommentString |
- {5:links to} Comment |
- {4:Press ENTER or type command to continue}^ |
+ {18:match} /\<endif\s\+".*$/ms=s+5,lc=5 {18:contains}=@vimCommentGroup,vimCommentString |
+ {18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:contains}=@vimCommentGroup,vimCommentString |
+ {18:links to} Comment |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@@ -1190,12 +1167,12 @@ describe('ui/builtin messages', function()
feed(':syntax list vimComment<cr>')
screen:expect([[
|
- {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 |
- {5:contains}=@vimCommentGroup,vimCommentString |
- {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:c}|
- {5:ontains}=@vimCommentGroup,vimCommentString |
- {5:links to} Comment |
- {4:Press ENTER or type command to continue}^ |
+ {18:match} /\<endif\s\+".*$/ms=s+5,lc=5 |
+ {18:contains}=@vimCommentGroup,vimCommentString |
+ {18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:c}|
+ {18:ontains}=@vimCommentGroup,vimCommentString |
+ {18:links to} Comment |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
@@ -1268,7 +1245,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
^ |
{1:~ }|*5
- {7: 0,0-1 All }|
+ {101: 0,0-1 All }|
]],
}
@@ -1277,7 +1254,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
^ |
{1:~ }|*5
- {7: 0,0-1 100% }|
+ {101: 0,0-1 100% }|
]],
}
end)
@@ -1291,7 +1268,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{3: }|
line 1 |
line 2 |
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]],
}
@@ -1315,7 +1292,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
|
{1:~ }|
- {8:[No Name] }|
+ {2:[No Name] }|
^ |
{1:~ }|
{3:[No Name] }|
@@ -1327,12 +1304,12 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
screen:expect {
grid = [[
:set colorcolumn=10 | digraphs |
- NU {5:^@} 10 SH {5:^A} 1 SX {5:^B} 2 EX {5:^C} 3 |
- ET {5:^D} 4 EQ {5:^E} 5 AK {5:^F} 6 BL {5:^G} 7 |
- BS {5:^H} 8 HT {5:^I} 9 LF {5:^@} 10 VT {5:^K} 11 |
- FF {5:^L} 12 CR {5:^M} 13 SO {5:^N} 14 SI {5:^O} 15 |
- DL {5:^P} 16 D1 {5:^Q} 17 D2 {5:^R} 18 D3 {5:^S} 19 |
- {4:-- More --}^ |
+ NU {18:^@} 10 SH {18:^A} 1 SX {18:^B} 2 EX {18:^C} 3 |
+ ET {18:^D} 4 EQ {18:^E} 5 AK {18:^F} 6 BL {18:^G} 7 |
+ BS {18:^H} 8 HT {18:^I} 9 LF {18:^@} 10 VT {18:^K} 11 |
+ FF {18:^L} 12 CR {18:^M} 13 SO {18:^N} 14 SI {18:^O} 15 |
+ DL {18:^P} 16 D1 {18:^Q} 17 D2 {18:^R} 18 D3 {18:^S} 19 |
+ {6:-- More --}^ |
]],
}
@@ -1341,8 +1318,8 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
|
{1:~ }|
- {8:[No Name] }|
- ^ {9: } |
+ {2:[No Name] }|
+ ^ {100: } |
{1:~ }|
{3:[No Name] }|
|
@@ -1353,13 +1330,13 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':set colorcolumn=5 | lua error("x\\n\\nx")<cr>')
screen:expect {
grid = [[
- {2:E5108: Error executing lua [string ":lua"]:1: x} |
+ {9:E5108: Error executing lua [string ":lua"]:1: x} |
|
- {2:x} |
- {2:stack traceback:} |
- {2: [C]: in function 'error'} |
- {2: [string ":lua"]:1: in main chunk} |
- {4:Press ENTER or type command to continue}^ |
+ {9:x} |
+ {9:stack traceback:} |
+ {9: [C]: in function 'error'} |
+ {9: [string ":lua"]:1: in main chunk} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
@@ -1368,8 +1345,8 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[
|
{1:~ }|
- {8:[No Name] }|
- ^ {9: } |
+ {2:[No Name] }|
+ ^ {100: } |
{1:~ }|
{3:[No Name] }|
|
@@ -1380,12 +1357,12 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':set colorcolumn=5 | lua error("x\\n\\n\\nx")<cr>')
screen:expect {
grid = [[
- {2:E5108: Error executing lua [string ":lua"]:1: x} |
+ {9:E5108: Error executing lua [string ":lua"]:1: x} |
|*2
- {2:x} |
- {2:stack traceback:} |
- {2: [C]: in function 'error'} |
- {4:-- More --}^ |
+ {9:x} |
+ {9:stack traceback:} |
+ {9: [C]: in function 'error'} |
+ {6:-- More --}^ |
]],
}
@@ -1393,11 +1370,11 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
screen:expect {
grid = [[
|*2
- {2:x} |
- {2:stack traceback:} |
- {2: [C]: in function 'error'} |
- {2: [string ":lua"]:1: in main chunk} |
- {4:Press ENTER or type command to continue}^ |
+ {9:x} |
+ {9:stack traceback:} |
+ {9: [C]: in function 'error'} |
+ {9: [string ":lua"]:1: in main chunk} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
end)
@@ -1413,10 +1390,10 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
|
{1:~ }|
{3: }|
- {10:wow, }{2:such} |
+ {10:wow, }{9:such} |
|
- {2:very }{11:color} |
- {4:Press ENTER or type command to continue}^ |
+ {9:very }{8:color} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
@@ -1435,10 +1412,10 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
|
{1:~ }|
{3: }|
- {10:wow, }{2:such} |
+ {10:wow, }{9:such} |
|
- {2:very }{11:color} |
- {4:Press ENTER or type command to continue}^ |
+ {9:very }{8:color} |
+ {6:Press ENTER or type command to continue}^ |
]],
}
end)
@@ -1449,19 +1426,19 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed('gggQ<CR><CR>1<CR><CR>vi')
screen:expect([[
Entering Ex mode. Type "visual" to go to Normal mode. |
- {11: 2 }bbb |
- {11: 3 }ccc |
+ {8: 2 }bbb |
+ {8: 3 }ccc |
:1 |
- {11: 1 }aaa |
- {11: 2 }bbb |
+ {8: 1 }aaa |
+ {8: 2 }bbb |
:vi^ |
]])
feed('<CR>')
screen:expect([[
- {11: 1 }aaa |
- {11: 2 }^bbb |
- {11: 3 }ccc |
- {11: 4 } |
+ {8: 1 }aaa |
+ {8: 2 }^bbb |
+ {8: 3 }ccc |
+ {8: 4 } |
{1:~ }|*2
|
]])
@@ -1502,7 +1479,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
aaa |
bbb |
ccc |
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]],
}
end
@@ -1534,7 +1511,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{1:~ }|*3
{3: }|
|
- {4:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<CR>')
screen:expect([[
@@ -1572,6 +1549,35 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
|*4
]])
end)
+
+ it('supports :intro with cmdheight=0 #26505', function()
+ screen:try_resize(80, 24)
+ command('set cmdheight=0')
+ feed(':intro<CR>')
+ screen:expect([[
+ |*5
+ {MATCH:.*}|
+ |
+ Nvim is open source and freely distributable |
+ https://neovim.io/#chat |
+ |
+ type :help nvim{18:<Enter>} if you are new! |
+ type :checkhealth{18:<Enter>} to optimize Nvim |
+ type :q{18:<Enter>} to exit |
+ type :help{18:<Enter>} for help |
+ |
+ {MATCH: +}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
+ |
+ Help poor children in Uganda! |
+ type :help iccf{18:<Enter>} for information |
+ |*2
+ {3: }|
+ |
+ {6:Press ENTER or type command to continue}^ |
+ ]])
+ feed('<CR>')
+ assert_alive()
+ end)
end)
it('calling screenstring() after redrawing between messages without UI #20999', function()
@@ -1592,21 +1598,12 @@ describe('ui/ext_messages', function()
clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
screen = Screen.new(80, 24)
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [3] = { bold = true },
- [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [5] = { foreground = Screen.colors.Blue1 },
- [6] = { reverse = true },
- [7] = { bold = true, reverse = true },
- })
end)
it('supports intro screen', function()
-- intro message is not externalized. But check that it still works.
-- Note parts of it depends on version or is indeterministic. We ignore those parts.
- screen:expect([[
+ local introscreen = [[
^ |
{1:~ }|*4
{MATCH:.*}|
@@ -1614,24 +1611,70 @@ describe('ui/ext_messages', function()
{1:~ }Nvim is open source and freely distributable{1: }|
{1:~ }https://neovim.io/#chat{1: }|
{1:~ }|
- {1:~ }type :help nvim{5:<Enter>} if you are new! {1: }|
- {1:~ }type :checkhealth{5:<Enter>} to optimize Nvim{1: }|
- {1:~ }type :q{5:<Enter>} to exit {1: }|
- {1:~ }type :help{5:<Enter>} for help {1: }|
+ {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
+ {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
+ {1:~ }type :q{18:<Enter>} to exit {1: }|
+ {1:~ }type :help{18:<Enter>} for help {1: }|
{1:~ }|
- {1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
+ {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
- {MATCH:.*}|*2
+ {1:~ }Help poor children in Uganda!{1: }|
+ {1:~ }type :help iccf{18:<Enter>} for information {1: }|
{1:~ }|*5
- ]])
-
- feed('<c-l>')
- screen:expect([[
+ ]]
+ local showmode = { { '-- INSERT --', 5 } }
+ screen:expect(introscreen)
+
+ -- <c-l> (same as :mode) does _not_ clear intro message
+ feed('<c-l>i')
+ screen:expect { grid = introscreen, showmode = showmode }
+
+ -- opening a float without focus also does not
+ local win = api.nvim_open_win(api.nvim_create_buf(false, false), false, {
+ relative = 'editor',
+ height = 1,
+ width = 5,
+ row = 1,
+ col = 5,
+ })
+ screen:expect {
+ grid = [[
^ |
+ {1:~ }{4: }{1: }|
+ {1:~ }|*3
+ {MATCH:.*}|
+ {1:~ }|
+ {1:~ }Nvim is open source and freely distributable{1: }|
+ {1:~ }https://neovim.io/#chat{1: }|
+ {1:~ }|
+ {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
+ {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
+ {1:~ }type :q{18:<Enter>} to exit {1: }|
+ {1:~ }type :help{18:<Enter>} for help {1: }|
+ {1:~ }|
+ {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
+ {1:~ }|
+ {1:~ }Help poor children in Uganda!{1: }|
+ {1:~ }type :help iccf{18:<Enter>} for information {1: }|
+ {1:~ }|*5
+ ]],
+ showmode = showmode,
+ }
+
+ api.nvim_win_close(win, true)
+ screen:expect { grid = introscreen, showmode = showmode }
+
+ -- but editing text does..
+ feed('x')
+ screen:expect {
+ grid = [[
+ x^ |
{1:~ }|*23
- ]])
+ ]],
+ showmode = showmode,
+ }
- feed(':intro<cr>')
+ feed('<esc>:intro<cr>')
screen:expect {
grid = [[
^ |
@@ -1641,20 +1684,81 @@ describe('ui/ext_messages', function()
Nvim is open source and freely distributable |
https://neovim.io/#chat |
|
- type :help nvim{5:<Enter>} if you are new! |
- type :checkhealth{5:<Enter>} to optimize Nvim |
- type :q{5:<Enter>} to exit |
- type :help{5:<Enter>} for help |
+ type :help nvim{18:<Enter>} if you are new! |
+ type :checkhealth{18:<Enter>} to optimize Nvim |
+ type :q{18:<Enter>} to exit |
+ type :help{18:<Enter>} for help |
|
- {MATCH: +}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
+ {MATCH: +}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
|
- {MATCH:.*}|*2
+ Help poor children in Uganda! |
+ type :help iccf{18:<Enter>} for information |
|*5
]],
messages = {
- { content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' },
+ { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
},
}
+
+ feed('<cr>')
+ screen:expect {
+ grid = [[
+ ^x |
+ {1:~ }|*23
+ ]],
+ }
+ end)
+
+ it('clears intro screen when new buffer is active', function()
+ api.nvim_set_current_buf(api.nvim_create_buf(true, false))
+ screen:expect {
+ grid = [[
+ ^ |
+ {1:~ }|*23
+ ]],
+ }
+ end)
+
+ it('clears intro screen when new buffer is active in floating window', function()
+ local win_opts = { relative = 'editor', height = 1, width = 5, row = 1, col = 5 }
+ api.nvim_open_win(api.nvim_create_buf(false, false), true, win_opts)
+ screen:expect {
+ grid = [[
+ |
+ {1:~ }{4:^ }{1: }|
+ {1:~ }|*22
+ ]],
+ }
+ end)
+
+ it('clears intro screen when initial buffer is active in floating window', function()
+ local win_opts = { relative = 'editor', height = 1, width = 5, row = 1, col = 5 }
+ api.nvim_open_win(api.nvim_get_current_buf(), true, win_opts)
+ screen:expect {
+ grid = [[
+ |
+ {1:~ }{4:^ }{1: }|
+ {1:~ }|*22
+ ]],
+ }
+ end)
+
+ it('clears intro screen when initial window is converted to be floating', function()
+ exec_lua([[
+ local init_win_id = vim.api.nvim_get_current_win()
+ vim.cmd('split')
+ local win_opts = { relative = 'editor', height = 1, width = 5, row = 1, col = 5 }
+ vim.api.nvim_win_set_config(init_win_id, win_opts)
+ vim.api.nvim_set_current_win(init_win_id)
+ ]])
+ screen:expect {
+ grid = [[
+ |
+ {1:~ }{4:^ }{1: }|
+ {1:~ }|*21
+ {2:[No Name] }|
+ ]],
+ }
end)
it('supports global statusline', function()
@@ -1668,7 +1772,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────|
|
{1:~ }|*10
- {7:[No Name] }|
+ {3:[No Name] }|
]],
messages = {
{ content = { { ' cmdheight=0' } }, kind = '' },
@@ -1684,7 +1788,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────|
|
{1:~ }|*9
- {7:[No Name] }|
+ {3:[No Name] }|
]],
messages = {
{ content = { { ' laststatus=3' } }, kind = '' },
@@ -1704,7 +1808,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────|
|
{1:~ }|*10
- {7:[No Name] }|
+ {3:[No Name] }|
]],
messages = {
{ content = { { ' cmdheight=0' } }, kind = '' },
@@ -1713,6 +1817,76 @@ describe('ui/ext_messages', function()
end)
end)
+it('ui/ext_multigrid supports intro screen', function()
+ clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
+ local screen = Screen.new(80, 24)
+ screen:attach({ rgb = true, ext_multigrid = true })
+
+ screen:expect {
+ grid = [[
+ ## grid 1
+ [2:--------------------------------------------------------------------------------]|*23
+ [3:--------------------------------------------------------------------------------]|
+ ## grid 2
+ ^ |
+ {1:~ }|*4
+ {MATCH:.*}|
+ {1:~ }|
+ {1:~ }Nvim is open source and freely distributable{1: }|
+ {1:~ }https://neovim.io/#chat{1: }|
+ {1:~ }|
+ {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
+ {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
+ {1:~ }type :q{18:<Enter>} to exit {1: }|
+ {1:~ }type :help{18:<Enter>} for help {1: }|
+ {1:~ }|
+ {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
+ {1:~ }|
+ {1:~ }Help poor children in Uganda!{1: }|
+ {1:~ }type :help iccf{18:<Enter>} for information {1: }|
+ {1:~ }|*4
+ ## grid 3
+ |
+ ]],
+ win_viewport = {
+ [2] = {
+ win = 1000,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 0,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
+ },
+ }
+
+ feed 'ix'
+ screen:expect {
+ grid = [[
+ ## grid 1
+ [2:--------------------------------------------------------------------------------]|*23
+ [3:--------------------------------------------------------------------------------]|
+ ## grid 2
+ x^ |
+ {1:~ }|*22
+ ## grid 3
+ {5:-- INSERT --} |
+ ]],
+ win_viewport = {
+ [2] = {
+ win = 1000,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 1,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
+ },
+ }
+end)
+
describe('ui/msg_puts_printf', function()
it('output multibyte characters correctly', function()
local screen
@@ -1728,16 +1902,12 @@ describe('ui/msg_puts_printf', function()
pending('missing japanese language features', function() end)
return
else
- cmd = 'chcp 932 > NULL & '
+ cmd = 'chcp 932 > NUL & '
end
else
if exc_exec('lang ja_JP.UTF-8') ~= 0 then
pending('Locale ja_JP.UTF-8 not supported', function() end)
return
- elseif is_ci() then
- -- Fails non--Windows CI. Message catalog directory issue?
- pending('fails on unix CI', function() end)
- return
end
end
@@ -1749,9 +1919,9 @@ describe('ui/msg_puts_printf', function()
cmd = cmd .. '"' .. nvim_prog .. '" -u NONE -i NONE -Es -V1'
command([[call termopen(']] .. cmd .. [[')]])
screen:expect([[
- ^Exモードに入ります. ノー |
- マルモードに戻るには"visu|
- al"と入力してください. |
+ ^Exモードに入ります。ノー |
+ マルモードに戻るには "vis|
+ ual" と入力してください。|
: |
|
]])
@@ -2378,4 +2548,221 @@ aliquip ex ea commodo consequat.]]
]],
}
end)
+
+ it('g< shows blank line from :echo properly', function()
+ screen:try_resize(60, 8)
+ feed([[:echo 1 | echo "\n" | echo 2<CR>]])
+ screen:expect([[
+ |
+ {1:~ }|*2
+ {12: }|
+ 1 |
+ |
+ 2 |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+
+ feed('<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|*6
+ |
+ ]])
+
+ feed('g<lt>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {12: }|
+ :echo 1 | echo "\n" | echo 2 |
+ 1 |
+ |
+ 2 |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+
+ feed('<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|*6
+ |
+ ]])
+ end)
+
+ it('scrolling works properly when :echo output ends with newline', function()
+ screen:try_resize(60, 6)
+ feed([[:echo range(100)->join("\n") .. "\n"<CR>]])
+ screen:expect([[
+ 0 |
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+ {4:-- More --}^ |
+ ]])
+ feed('G')
+ screen:expect([[
+ 96 |
+ 97 |
+ 98 |
+ 99 |
+ |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+ for _ = 1, 3 do
+ feed('k')
+ screen:expect([[
+ 95 |
+ 96 |
+ 97 |
+ 98 |
+ 99 |
+ {4:-- More --}^ |
+ ]])
+ feed('k')
+ screen:expect([[
+ 94 |
+ 95 |
+ 96 |
+ 97 |
+ 98 |
+ {4:-- More --}^ |
+ ]])
+ feed('j')
+ screen:expect([[
+ 95 |
+ 96 |
+ 97 |
+ 98 |
+ 99 |
+ {4:-- More --}^ |
+ ]])
+ feed('j')
+ screen:expect([[
+ 96 |
+ 97 |
+ 98 |
+ 99 |
+ |
+ {4:-- More --}^ |
+ ]])
+ feed('j')
+ screen:expect([[
+ 96 |
+ 97 |
+ 98 |
+ 99 |
+ |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+ end
+ end)
+
+ it('scrolling works properly when :!cmd output ends with newline #27902', function()
+ screen:try_resize(60, 6)
+ api.nvim_set_option_value('shell', testprg('shell-test'), {})
+ api.nvim_set_option_value('shellcmdflag', 'REP 100', {})
+ api.nvim_set_option_value('shellxquote', '', {}) -- win: avoid extra quotes
+ feed([[:!foo<CR>]])
+ screen:expect([[
+ 96: foo |
+ 97: foo |
+ 98: foo |
+ 99: foo |
+ |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+ for _ = 1, 3 do
+ feed('k')
+ screen:expect([[
+ 95: foo |
+ 96: foo |
+ 97: foo |
+ 98: foo |
+ 99: foo |
+ {4:-- More --}^ |
+ ]])
+ feed('k')
+ screen:expect([[
+ 94: foo |
+ 95: foo |
+ 96: foo |
+ 97: foo |
+ 98: foo |
+ {4:-- More --}^ |
+ ]])
+ feed('j')
+ screen:expect([[
+ 95: foo |
+ 96: foo |
+ 97: foo |
+ 98: foo |
+ 99: foo |
+ {4:-- More --}^ |
+ ]])
+ feed('j')
+ screen:expect([[
+ 96: foo |
+ 97: foo |
+ 98: foo |
+ 99: foo |
+ |
+ {4:-- More --}^ |
+ ]])
+ feed('j')
+ screen:expect([[
+ 96: foo |
+ 97: foo |
+ 98: foo |
+ 99: foo |
+ |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+ end
+ end)
+end)
+
+it('pager works in headless mode with UI attached', function()
+ skip(is_os('win'))
+ clear()
+ local child_server = assert(n.new_pipename())
+ fn.jobstart({ nvim_prog, '--clean', '--headless', '--listen', child_server })
+ retry(nil, nil, function()
+ neq(nil, vim.uv.fs_stat(child_server))
+ end)
+
+ local child_session = n.connect(child_server)
+ local child_screen = Screen.new(40, 6)
+ 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_screen:expect([[
+ 0 |
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+ -- More --^ |
+ ]])
+
+ child_session:request('nvim_input', 'G')
+ child_screen:expect([[
+ 95 |
+ 96 |
+ 97 |
+ 98 |
+ 99 |
+ Press ENTER or type command to continue^ |
+ ]])
+
+ child_session:request('nvim_input', 'g')
+ child_screen:expect([[
+ 0 |
+ 1 |
+ 2 |
+ 3 |
+ 4 |
+ -- More --^ |
+ ]])
end)
diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua
index 8d7fae3e91..f623cfda06 100644
--- a/test/functional/ui/mode_spec.lua
+++ b/test/functional/ui/mode_spec.lua
@@ -1,9 +1,10 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command = helpers.command
-local retry = helpers.retry
+local clear, feed, insert = n.clear, n.feed, n.insert
+local command = n.command
+local retry = t.retry
describe('ui mode_change event', function()
local screen
@@ -12,20 +13,13 @@ describe('ui mode_change event', function()
clear()
screen = Screen.new(25, 4)
screen:attach({ rgb = true })
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = 255 },
- [1] = { bold = true, reverse = true },
- [2] = { bold = true },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg
- })
end)
it('works in normal mode', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -35,7 +29,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'operator',
@@ -45,7 +39,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -61,7 +55,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'operator',
@@ -71,8 +65,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {4:E21: Cannot make changes, 'modifiable' is off} |
+ {1:~ }|*2
+ {9:E21: Cannot make changes, 'modifiable' is off} |
]],
mode = 'normal',
}
@@ -84,7 +78,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'replace',
@@ -94,7 +88,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -106,8 +100,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
}
@@ -116,7 +110,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -133,8 +127,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@@ -144,8 +138,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word^(stuff) |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'showmatch',
timeout = screen_timeout,
@@ -154,8 +148,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff)^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@@ -168,8 +162,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {2:-- REPLACE --} |
+ {1:~ }|*2
+ {5:-- REPLACE --} |
]],
mode = 'replace',
}
@@ -178,7 +172,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -190,7 +184,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^ |
]],
mode = 'cmdline_normal',
@@ -200,7 +194,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^x |
]],
mode = 'cmdline_insert',
@@ -210,7 +204,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^x |
]],
mode = 'cmdline_replace',
@@ -220,7 +214,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:x^ |
]],
mode = 'cmdline_normal',
@@ -230,7 +224,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -243,8 +237,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
- {2:-- VISUAL --} |
+ {1:~ }|*2
+ {5:-- VISUAL --} |
]],
mode = 'visual',
}
@@ -253,7 +247,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -264,8 +258,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
- {2:-- VISUAL --} |
+ {1:~ }|*2
+ {5:-- VISUAL --} |
]],
mode = 'visual_select',
}
@@ -274,7 +268,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index 0f30bf4471..42c877fd92 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -1,11 +1,13 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, api = helpers.clear, helpers.feed, helpers.api
-local insert, feed_command = helpers.insert, helpers.feed_command
-local eq, fn = helpers.eq, helpers.fn
-local poke_eventloop = helpers.poke_eventloop
-local command = helpers.command
-local exec = helpers.exec
+
+local clear, feed, api = n.clear, n.feed, n.api
+local insert, feed_command = n.insert, n.feed_command
+local eq, fn = t.eq, n.fn
+local poke_eventloop = n.poke_eventloop
+local command = n.command
+local exec = n.exec
describe('ui/mouse/input', function()
local screen
@@ -34,6 +36,7 @@ describe('ui/mouse/input', function()
[6] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[7] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[8] = { foreground = Screen.colors.Brown },
+ [9] = { background = Screen.colors.DarkGrey, foreground = Screen.colors.LightGrey },
})
command('set mousemodel=extend')
feed('itesting<cr>mouse<cr>support and selection<esc>')
@@ -574,7 +577,7 @@ describe('ui/mouse/input', function()
:tabprevious |
]])
feed('<LeftMouse><10,0><LeftRelease>') -- go to second tab
- helpers.poke_eventloop()
+ n.poke_eventloop()
feed('<LeftMouse><0,1>')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -1638,6 +1641,59 @@ describe('ui/mouse/input', function()
end)
end)
+ it('virtual text does not change cursor placement on concealed line', function()
+ command('%delete')
+ insert('aaaaaaaaaa|hidden|bbbbbbbbbb|hidden|cccccccccc')
+ command('syntax match test /|hidden|/ conceal cchar=X')
+ command('set conceallevel=2 concealcursor=n virtualedit=all')
+ screen:expect([[
+ aaaaaaaaaa{9:X}bbbbbbb |
+ bbb{9:X}ccccccccc^c |
+ {0:~ }|*2
+ |
+ ]])
+ api.nvim_input_mouse('left', 'press', '', 0, 0, 22)
+ screen:expect([[
+ aaaaaaaaaa{9:X}bbbbbb^b |
+ bbb{9:X}cccccccccc |
+ {0:~ }|*2
+ |
+ ]])
+ api.nvim_input_mouse('left', 'press', '', 0, 1, 16)
+ screen:expect([[
+ aaaaaaaaaa{9:X}bbbbbbb |
+ bbb{9:X}cccccccccc ^ |
+ {0:~ }|*2
+ |
+ ]])
+
+ api.nvim_buf_set_extmark(0, api.nvim_create_namespace(''), 0, 0, {
+ virt_text = { { '?', 'ErrorMsg' } },
+ virt_text_pos = 'right_align',
+ virt_text_repeat_linebreak = true,
+ })
+ screen:expect([[
+ aaaaaaaaaa{9:X}bbbbbbb {6:?}|
+ bbb{9:X}cccccccccc ^ {6:?}|
+ {0:~ }|*2
+ |
+ ]])
+ api.nvim_input_mouse('left', 'press', '', 0, 0, 22)
+ screen:expect([[
+ aaaaaaaaaa{9:X}bbbbbb^b {6:?}|
+ bbb{9:X}cccccccccc {6:?}|
+ {0:~ }|*2
+ |
+ ]])
+ api.nvim_input_mouse('left', 'press', '', 0, 1, 16)
+ screen:expect([[
+ aaaaaaaaaa{9:X}bbbbbbb {6:?}|
+ bbb{9:X}cccccccccc ^ {6:?}|
+ {0:~ }|*2
+ |
+ ]])
+ end)
+
it('getmousepos() works correctly', function()
local winwidth = api.nvim_get_option_value('winwidth', {})
-- Set winwidth=1 so that window sizes don't change.
@@ -1802,8 +1858,8 @@ describe('ui/mouse/input', function()
it('feeding <MouseMove> in Normal mode does not use uninitialized memory #19480', function()
feed('<MouseMove>')
- helpers.poke_eventloop()
- helpers.assert_alive()
+ n.poke_eventloop()
+ n.assert_alive()
end)
it('mousemodel=popup_setpos', function()
diff --git a/test/functional/ui/multibyte_spec.lua b/test/functional/ui/multibyte_spec.lua
index c2fc763401..dc25a09d0d 100644
--- a/test/functional/ui/multibyte_spec.lua
+++ b/test/functional/ui/multibyte_spec.lua
@@ -1,14 +1,16 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local feed = helpers.feed
-local feed_command = helpers.feed_command
-local insert = helpers.insert
-local fn = helpers.fn
-local api = helpers.api
+
+local clear = n.clear
+local command = n.command
+local feed = n.feed
+local feed_command = n.feed_command
+local insert = n.insert
+local fn = n.fn
+local api = n.api
local split = vim.split
-local dedent = helpers.dedent
+local dedent = t.dedent
describe('multibyte rendering', function()
local screen
@@ -16,15 +18,6 @@ describe('multibyte rendering', function()
clear()
screen = Screen.new(60, 6)
screen:attach({ rgb = true })
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue },
- [2] = { background = Screen.colors.WebGray },
- [3] = { background = Screen.colors.LightMagenta },
- [4] = { bold = true },
- [5] = { foreground = Screen.colors.Blue },
- [6] = { reverse = true, bold = true },
- [7] = { reverse = true },
- })
end)
it('works with composed char at start of line', function()
@@ -83,17 +76,17 @@ describe('multibyte rendering', function()
ab ^ |
-馬 |
{1:~ }|*3
- {4:-- INSERT --} |
+ {5:-- INSERT --} |
]])
-- check double-width char is temporarily hidden when overlapped
fn.complete(4, { 'xx', 'yy' })
screen:expect([[
ab xx^ |
- - {2: xx } |
- {1:~ }{3: yy }{1: }|
+ - {12: xx } |
+ {1:~ }{4: yy }{1: }|
{1:~ }|*2
- {4:-- INSERT --} |
+ {5:-- INSERT --} |
]])
-- check it is properly restored
@@ -102,7 +95,7 @@ describe('multibyte rendering', function()
ab xxz^ |
-馬 |
{1:~ }|*3
- {4:-- INSERT --} |
+ {5:-- INSERT --} |
]])
end)
@@ -129,7 +122,7 @@ describe('multibyte rendering', function()
{1:~ }│a口口口口口口口口口口口口口口口口 |
{1:~ }│aa口口口口口口口口口口口口口口口口 |
{1:~ }│aaa口口口口口口口口口口口口口口口口 |
- {6:[No Name] }{7:[No Name] [+] }|
+ {3:[No Name] }{2:[No Name] [+] }|
|
]])
end)
@@ -139,7 +132,7 @@ describe('multibyte rendering', function()
feed('$')
screen:expect {
grid = [[
- {5:<ffff>}!!^! |
+ {18:<ffff>}!!^! |
{1:~ }|*4
|
]],
@@ -204,6 +197,32 @@ describe('multibyte rendering', function()
}
end)
+ it('works with even huger zalgo chars', function()
+ screen:try_resize(100, 20)
+ api.nvim_command 'color default'
+ api.nvim_set_hl(0, 'MyHighlight', { bg = '#53246b', fg = '#a4d844' })
+ screen:add_extra_attr_ids {
+ [100] = { background = tonumber('0x53246b'), foreground = Screen.colors.NvimLightGrey4 },
+ [101] = { background = tonumber('0x53246b'), foreground = tonumber('0xa4d844') },
+ }
+ api.nvim_set_option_value('winhl', 'Normal:MyHighlight', {})
+ api.nvim_set_option_value('number', true, {})
+ local text =
+ 'c̯̥̳̮̫̳͔̱̀ͦͩ̄͋̓͘c̯̥̳̮̫̳͔̱̀ͦͩ̄͋̓͘l̶̴̴̨̛͓͚͎̥ͦͤ̑͆͛͢l̶̴̴̨̛͓͚͎̥ͦͤ̑͆͛͢ô̷̤̩ͯͧ͆ͪ̈́́͒̒̐͐̕ô̷̤̩ͯͧ͆ͪ̈́́͒̒̐͐̕s̶̷̢̩̱̠̀ͦ̽ͮ͒ͨ̚͟͠s̶̷̢̩̱̠̀ͦ̽ͮ͒ͨ̚͟͠e͉̯̱̖͕̳̼̽̊̒ͣ̊ͥ̚̚e͉̯̱̖͕̳̼̽̊̒ͣ̊ͥ̚̚ ͇͌̈̄ͬͧͧ͝͠͏̷ͪ̎͟͠ ͇͌̈̄ͬͧͧ͝͠͏̷ͪ̎͟͠t̵̳̅̽͏̵̡̥̲͍͙̹̯ͩ̐t̵̳̅̽͏̵̡̥̲͍͙̹̯ͩ̐o͋͏̬̞̣ͬ́ͬ̎̋̓̽͘͠͡o͋͏̬̞̣ͬ́ͬ̎̋̓̽͘͠͡ ͏̛͙̮̈ͬ̌͐ͤ͒ͧ̎ͤ͜͠ ͏̛͙̮̈ͬ̌͐ͤ͒ͧ̎ͤ͜͠ǫ̛̳͕̦͖̪̀͂͛̅̔ͪ͒͜ǫ̛̳͕̦͖̪̀͂͛̅̔ͪ͒͜v̸̡͖̗̣ͯ̿̔͊̅ͯ̈̓̇ͅv̸̡͖̗̣ͯ̿̔͊̅ͯ̈̓̇ͅe̴̶̢̜̭̠̰̞ͪͨ͂ͤ͆́͗e̴̶̢̜̭̠̰̞ͪͨ͂ͤ͆́͗r̨̖̼̳̳͚̖̒ͯ̊̋̂̑̚͞r̨̖̼̳̳͚̖̒ͯ̊̋̂̑̚͞f̵̮̣̬̾͛̌ͧͦ͘͢͜͜͠ͅf̵̮̣̬̾͛̌ͧͦ͘͢͜͜͠ͅl̡͉̬̳͈̠̏͂ͤ̈ͨ̀ͩ̔͏l̡͉̬̳͈̠̏͂ͤ̈ͨ̀ͩ̔͏ỏ̶̢̻̠͎͇͈̜̈̆ͯ̔ͩ̾ỏ̶̢̻̠͎͇͈̜̈̆ͯ̔ͩ̾ẉ̦̞̼̩̣͙̅̿́̓̉̎̈ͪẉ̦̞̼̩̣͙̅̿́̓̉̎̈ͪi̷̡͍͓͔̝͙͖͖̍ͯͤͬͦ͝i̷̡͍͓͔̝͙͖͖̍ͯͤͬͦ͝n̠̪̰͋ͩ̆͏̶̖̯ͭ̀̿͛͘n̠̪̰͋ͩ̆͏̶̖̯ͭ̀̿͛͘g̴̭͎̞͙̗̯͙͖ͬ́ͧͧ͝ͅg̴̭͎̞͙̗̯͙͖ͬ́ͧͧ͝ͅ ̢͎̬͓̮̹̰̙͍̓̐͋͂͐̚ ̢͎̬͓̮̹̰̙͍̓̐͋͂͐̚ť̴̼̝̗ͩ̍͋̿͏͇ͧ̑̏̚ť̴̼̝̗ͩ̍͋̿͏͇ͧ̑̏̚h̨̨̢͓̲͚͕̦ͨ͛̓ͩ̚͟͠h̨̨̢͓̲͚͕̦ͨ͛̓ͩ̚͟͠ȩ͕̜̥̃̑͋̏͐̎̒͛͊͏͙ȩ͕̜̥̃̑͋̏͐̎̒͛͊͏͙ ̵̨̜̜̠͉̱͎͑ͥ̌͐̽͢͡ ̵̨̜̜̠͉̱͎͑ͥ̌͐̽͢͡r̢̫͓͎̙̭̽ͥͭ͐̂̀̕͟͝r̢̫͓͎̙̭̽ͥͭ͐̂̀̕͟͝e̴̷͓̹̩ͧ́̉̑̈̿ͥ̕͡͝e̴̷͓̹̩ͧ́̉̑̈̿ͥ̕͡͝d̵̡̼̩̠̜͈̯̬͚͛̋̀̆͟d̵̡̼̩̠̜͈̯̬͚͛̋̀̆͟ŕ̻̳̬͏̨̮͚̲ͥ̌͆͗͠ͅŕ̻̳̬͏̨̮͚̲ͥ̌͆͗͠ͅā̸͙̥̤͍͈̣ͪͨ̈͋̈́̈́͜ā̸͙̥̤͍͈̣ͪͨ̈͋̈́̈́͜w̶̦̪͚̤̃ͬ̓͒ͤ̇̇ͮ͢͡w̶̦̪͚̤̃ͬ̓͒ͤ̇̇ͮ͢͡ ̷̡̦̻̻̪͚̳͎ͥ̓ͩͪ͠͝ ̷̡̦̻̻̪͚̳͎ͥ̓ͩͪ͠͝b̳ͮ̒̊̆̒́̈́̏̓͋ͭ̔ͤ̚b̳ͮ̒̊̆̒́̈́̏̓͋ͭ̔ͤ̚u̧̟̫͎͚̭̠͕͂̄̀̒̈̇͜u̧̟̫͎͚̭̠͕͂̄̀̒̈̇͜f̶̸̢͍̑̂̊ͥͫ̈́ͥ͛̈́̃͝f̶̸̢͍̑̂̊ͥͫ̈́ͥ͛̈́̃͝f̵̼̭̮͎ͧ̒̆͊̀ͤ͊̇̕͡f̵̼̭̮͎ͧ̒̆͊̀ͤ͊̇̕͡e̮̪̲̣̞̖͎ͥͤ̐̌̓̐͟͢e̮̪̲̣̞̖͎ͥͤ̐̌̓̐͟͢ŗ̭̘̮̹̖̎̄̆́ͫͭ͢ͅͅŗ̭̘̮̹̖̎̄̆́ͫͭ͢ͅͅ.̪̖͉͚̹̾̉ͮ̔̊ͪ̾̎͟͞.̪̖͉͚̹̾̉ͮ̔̊ͪ̾̎͟͞ ̷̧̺̰͎̣̃͒͗ͮ͑ͪͮ͞ͅ ̷̧̺̰͎̣̃͒͗ͮ͑ͪͮ͞ͅf̛̫͚͚͍̜͎̗̳̂ͬͭ͜͢͝f̛̫͚͚͍̜͎̗̳̂ͬͭ͜͢͝i̴̵̡̛̛͎̤̳̮ͩ̐ͩ͑̇̚i̴̵̡̛̛͎̤̳̮ͩ̐ͩ͑̇̚n̵͇͍͚̖̥̣ͨ̄ͧ̌̂͗͘͝n̵͇͍͚̖̥̣ͨ̄ͧ̌̂͗͘͝ȉ̼̱̫̜̋̓̐͌͆ͨ͘͝͡ͅȉ̼̱̫̜̋̓̐͌͆ͨ͘͝͡ͅs̴̸̝̺̬͚̲̹̘ͪ̆̊ͥ͞͝s̴̸̝̺̬͚̲̹̘ͪ̆̊ͥ͞͝h̴̜̠͇ͦͥ̔̅ͭͭ͋ͩ͟͡͞h̴̜̠͇ͦͥ̔̅ͭͭ͋ͩ͟͡͞ ̶̧̛̻͙̤̘̺̣̻̗͍̓͑͠ ̶̧̛̻͙̤̘̺̣̻̗͍̓͑͠t̠͉̼̬̩͛́ͨ͐̀͛̂ͨ̾͞t̠͉̼̬̩͛́ͨ͐̀͛̂ͨ̾͞h̻̹̝̹̾ͩ̍ͧ͆ͥ̔͘͏̉ͯh̻̹̝̹̾ͩ̍ͧ͆ͥ̔͘͏̉ͯì̷̢̛̺̭͇̟̦̄̓́̓ͪ͟ì̷̢̛̺̭͇̟̦̄̓́̓ͪ͟s̴̡̗͍͕͖̮̟̱̫̎ͣ̀̎̿s̴̡̗͍͕͖̮̟̱̫̎ͣ̀̎̿ ̶͇̟̜̗̗͇͇͐̑̈͋̋̽͟ ̶͇̟̜̗̗͇͇͐̑̈͋̋̽͟e̷̥͙͈̖̤̯̹̯͗̉̈́̽ͨ̕e̷̥͙͈̖̤̯̹̯͗̉̈́̽ͨ̕v̛̝͕̱͙̞̖̒̂̔͆̊̎́ͫv̛̝͕̱͙̞̖̒̂̔͆̊̎́ͫę̴̤̭͖̈̐̿͂ͣ͒̃ͭ̕͟ę̴̤̭͖̈̐̿͂ͣ͒̃ͭ̕͟ṇ̳̭͓̟̠͕̯͑̉ͦ̀ͯ͜͡ṇ̳̭͓̟̠͕̯͑̉ͦ̀ͯ͜͡t̢̞͔̣̄̀͆̂̃ͨͦ͜͜͝͠t̢̞͔̣̄̀͆̂̃ͨͦ͜͜͝͠,̬̳̮͓͉̟͉͓̦͔̑̄ͨ̎͜,̬̳̮͓͉̟͉͓̦͔̑̄ͨ̎͜ ͕͈̠̰̬̬̌͂̏ͥ̀̕̚͢͠ ͕͈̠̰̬̬̌͂̏ͥ̀̕̚͢͠f̺̮̞̈́̏̋͏̺̖̝̓̑̂̚͢f̺̮̞̈́̏̋͏̺̖̝̓̑̂̚͢l̜̪͍̩̩̟͉͓̊̓ͤ̆ͣͫ̌l̜̪͍̩̩̟͉͓̊̓ͤ̆ͣͫ̌u̷̧̞̳̱̜̟̲͑̐͂ͪ͛͘͟u̷̧̞̳̱̜̟̲͑̐͂ͪ͛͘͟s͔͍̽ͣͮ̏̓͛̄ͯ̽͂̐ͯ͜s͔͍̽ͣͮ̏̓͛̄ͯ̽͂̐ͯ͜ḩ̼͕̦͖̼͚̗̃̃ͥ̅̂̈͟ḩ̼͕̦͖̼͚̗̃̃ͥ̅̂̈͟,̵͍̮̮̟͚̝̃ͨ̿ͭ̌ͤ̋̊,̵͍̮̮̟͚̝̃ͨ̿ͭ̌ͤ̋̊ ̷̨̨͈̝̦͂ͦ̒̋̇ͧ̒͟͝ ̷̨̨͈̝̦͂ͦ̒̋̇ͧ̒͟͝a̡̨̲̖̾̂͗̚͢͡͏͈ͤ̉͡a̡̨̲̖̾̂͗̚͢͡͏͈ͤ̉͡nͫͤ̚͜͏̧̛̣̻ͩ̔̍ͦ̕͝nͫͤ̚͜͏̧̛̣̻ͩ̔̍ͦ̕͝d͈̻̗̼̀͡͏̶̵̟̹̻̎̾ͯd͈̻̗̼̀͡͏̶̵̟̹̻̎̾ͯ ̶͙͈̠̜̬̺͛̀̊̂ͪ̔ͮ͑ ̶͙͈̠̜̬̺͛̀̊̂ͪ̔ͮ͑ş̧̡̢͓̠͋ͫ͑͒͊̅̔͜͞ş̧̡̢͓̠͋ͫ͑͒͊̅̔͜͞t̤̭͓̰̣̉̔̎ͫ͛ͦ̑̕͟͞t̤̭͓̰̣̉̔̎ͫ͛ͦ̑̕͟͞a̠͇͇̯̥͍͚̳̒́͐͐̏͋̓a̠͇͇̯̥͍͚̳̒́͐͐̏͋̓r͉͈̻̻͕̩̩̃̅͋͆ͮ͢͢͡r͉͈̻̻͕̩̩̃̅͋͆ͮ͢͢͡t̵̛̝̗̥̙̟̆ͮ̽̏ͧ͜͠ͅt̵̛̝̗̥̙̟̆ͮ̽̏ͧ͜͠ͅ ̷̼͎̦ͫ̈͑̃̽͏̲̪ͣͯ̽ ̷̼͎̦ͫ̈͑̃̽͏̲̪ͣͯ̽á̸̷̴̟̣́̔̌͏̶͕͋ͭͭá̸̷̴̟̣́̔̌͏̶͕͋ͭͭ ̧̧̲͍̘̘͚͔͇͙ͨͬ́̊ͅ ̧̧̲͍̘̘͚͔͇͙ͨͬ́̊ͅn̸̸̩͖͔͚͚̖͗ͦ̓̀̀̈́̈́n̸̸̩͖͔͚͚̖͗ͦ̓̀̀̈́̈́ę̵̧̬̣̦̖̝̹̱͌̃̑ͣ̚ę̵̧̬̣̦̖̝̹̱͌̃̑ͣ̚w͍̥͚̺ͮ̓̈̈́̾̊̆́̚͜͝w͍̥͚̺ͮ̓̈̈́̾̊̆́̚͜͝ ̛̹̲̥̝͙̾ͨ̆̎̃̋͂̓̕ ̛̹̲̥̝͙̾ͨ̆̎̃̋͂̓̕"̴̜̰̰̱̖̙̘̈́͌ͨͪ̐̕͠"̴̜̰̰̱̖̙̘̈́͌ͨͪ̐̕͠g̸̛͇̐͊͂̽͢͏͖̣ͫ͊ͯͅg̸̛͇̐͊͂̽͢͏͖̣ͫ͊ͯͅr̴̨̲͎̹͇̠̐ͤ̇̒ͬ̆ͧ͞r̴̨̲͎̹͇̠̐ͤ̇̒ͬ̆ͧ͞į̝̱̩͔̈ͨ̉͌̋̍̂͜͟͞į̝̱̩͔̈ͨ̉͌̋̍̂͜͟͞d̷̴̷̟̎͌͑͛̈́ͭͨͯ̋ͭ̕d̷̴̷̟̎͌͑͛̈́ͭͨͯ̋ͭ̕_̢̭̙̦̪͇̾̔̆ͬͦ́ͥ͢͡_̢̭̙̦̪͇̾̔̆ͬͦ́ͥ͢͡l̡̢̨̧͔̱̥̹̬̆ͮ̈́̏̅͜l̡̢̨̧͔̱̥̹̬̆ͮ̈́̏̅͜ĩ̢͖̠̩̞͚̰̰̉̋̌͛ͪ͠ĩ̢͖̠̩̞͚̰̰̉̋̌͛ͪ͠n̢̬̜̘̲͉ͮ͆͏̯͕ͭͦ̉̅n̢̬̜̘̲͉ͮ͆͏̯͕ͭͦ̉̅ē̡͈̮̭̰̜͍̗̮͔͌͐͆ͫē̡͈̮̭̰̜͍̗̮͔͌͐͆ͫ"̦̠̟ͣ̽͋͐ͧ̓̂̆̎͒͝ͅ"̦̠̟ͣ̽͋͐ͧ̓̂̆̎͒͝ͅ ̴̡̺̹̖̰̀ͤ͊̊͗̊́͜͠ ̴̡̺̹̖̰̀ͤ͊̊͗̊́͜͠ẻ͎̳̻̯̹͓͊̌̄͑͂̉͜͢ẻ͎̳̻̯̹͓͊̌̄͑͂̉͜͢v̞̬̪̥͖ͤ͐̍́ͤ̇̀̕̕ͅv̞̬̪̥͖ͤ͐̍́ͤ̇̀̕̕ͅȇ̶̱̗̩̠͚͎͊ͤͪͦͫ̂̚ȇ̶̱̗̩̠͚͎͊ͤͪͦͫ̂̚n̢̮̜͉̎ͨͩ̒̓ͬͨ̓ͦ͘͜n̢̮̜͉̎ͨͩ̒̓ͬͨ̓ͦ͘͜t̢͚͉̹͇̺̭ͪ̄̉ͨ̄͐̕ͅt̢͚͉̹͇̺̭ͪ̄̉ͨ̄͐̕ͅ ̵̛̳̱͍̩͓ͣ͋̈́͐ͭͧ̿ͅ ̵̛̳̱͍̩͓ͣ͋̈́͐ͭͧ̿ͅã̰̪̙͉̪͇ͣ͋ͤ̓͋͑̕͘ã̰̪̙͉̪͇ͣ͋ͤ̓͋͑̕͘t̴̴̡̡̛̳̼̻̳̂̽͒̇̚͠t̴̴̡̡̛̳̼̻̳̂̽͒̇̚͠ ̴̙̤̹͔̳̟̽̀̆ͥ̂̕͘͝ ̴̙̤̹͔̳̟̽̀̆ͥ̂̕͘͝t̴͖̼͔̬̦̏ͩ̄́̓̊̔̇͡t̴͖̼͔̬̦̏ͩ̄́̓̊̔̇͡ḫ̷͚͇̫̫̠͒ͮ̍ͣ̃͐͐̍ḫ̷͚͇̫̫̠͒ͮ̍ͣ̃͐͐̍e̳͉̮͖̳̣̎͌̂ͣ͋ͯ̆͜͞e̳͉̮͖̳̣̎͌̂ͣ͋ͯ̆͜͞ ̪̖̉̌̀̽̄̍̓̀̂̋͐̈̚ ̪̖̉̌̀̽̄̍̓̀̂̋͐̈̚c̶̫̜͚̊̿̂̿ͥͭ̓̂̈́͘͡c̶̫̜͚̊̿̂̿ͥͭ̓̂̈́͘͡ṷ̵̷͉̯̜̬̝̑͛ͤ̋ͧͯ̉ṷ̵̷͉̯̜̬̝̑͛ͤ̋ͧͯ̉ŗ̙̬̺̬ͥͤ̓͐̈́ͬ̽̌͡͡ŗ̙̬̺̬ͥͤ̓͐̈́ͬ̽̌͡͡r̛͖̼̣͙̋̇̀̅͒̽ͥ̑ͅͅr̛͖̼̣͙̋̇̀̅͒̽ͥ̑ͅͅě̢̪̦̼͘͏̴̠̞͍̓̐ͭ̇ě̢̪̦̼͘͏̴̠̞͍̓̐ͭ̇ǹ̨̨̛̛̯̍ͭͫ̎̍̃̄̐̍ǹ̨̨̛̛̯̍ͭͫ̎̍̃̄̐̍t̵̳͔̭̮̭̱̰ͤ͐̉̾͗̅͢t̵̳͔̭̮̭̱̰ͤ͐̉̾͗̅͢ ̩͕ͧ̌͂͂́ͫͥ̍͏̬̙͗ͅ ̩͕ͧ̌͂͂́ͫͥ̍͏̬̙͗ͅp̞̞͇͇̯̩̬̜ͥ̃͐̑͋́͗p̞̞͇͇̯̩̬̜ͥ̃͐̑͋́͗o̵͖͈̩̪̥̝̊̒̉̿͋ͩ̆͠o̵͖͈̩̪̥̝̊̒̉̿͋ͩ̆͠s̶͇̺̩̟̺͋̆̒ͫͥ̆͏͔͜s̶͇̺̩̟̺͋̆̒ͫͥ̆͏͔͜i̞̝̭̲͈̝̮̫͚͑̓ͤ̎ͮ̀i̞̝̭̲͈̝̮̫͚͑̓ͤ̎ͮ̀t̷̬͇̗̥̳͔̮͔̎̀ͣ̊̕͢t̷̬͇̗̥̳͔̮͔̎̀ͣ̊̕͢i̶̧̗̠̗̲͑̋ͣͪͦͣ͆̕͢i̶̧̗̠̗̲͑̋ͣͪͦͣ͆̕͢ǫ̰̟̙ͯ͏̬̦͚̝̀̈́ͣ͘͜ǫ̰̟̙ͯ͏̬̦͚̝̀̈́ͣ͘͜n̸̻̩͖͓̠̲̮̐̄̌̇́́͠n̸̻̩͖͓̠̲̮̐̄̌̇́́͠.̧̛͈̙̭̉ͥ̋͛̏͋̂̿͛͞.̧̛͈̙̭̉ͥ̋͛̏͋̂̿͛͞ ̡̲͇̳͔̦̤̹̥ͣ̍ͪͮ̎͡ ̡̲͇̳͔̦̤̹̥ͣ̍ͪͮ̎͡F̼̣͙̳̞͑͒ͧͣ̔̊̇̓̈́͠F̼̣͙̳̞͑͒ͧͣ̔̊̇̓̈́͠ŏ̸̶͎̘̟͙̤̑̒̿͗͛̐̚ŏ̸̶͎̘̟͙̤̑̒̿͗͛̐̚r̵̰͇͚̥̻͚̈́̌̽ͨͥ̕͘͞r̵̰͇͚̥̻͚̈́̌̽ͨͥ̕͘͞ ̵̶̧͖̙̝̻̭̤̒̿͌͗͑͡ ̵̶̧͖̙̝̻̭̤̒̿͌͗͑͡ś̸̬̘̭̼͓̹ͥ͛ͪ̐̈́͆͝ś̸̬̘̭̼͓̹ͥ͛ͪ̐̈́͆͝i͎̺̪̖̻ͫ̀ͤ̾ͦ̽ͭ͒̒͘i͎̺̪̖̻ͫ̀ͤ̾ͦ̽ͭ͒̒͘m̨̩͎̫̫̙̃̈͆ͬ̊͠͏̽͞m̨̩͎̫̫̙̃̈͆ͬ̊͠͏̽͞p̴̢̨͖̼͍̲͍̲ͩ̊̒̌̃ͤp̴̢̨͖̼͍̲͍̲ͩ̊̒̌̃ͤļ͔̱͙̝̟̜͚͎͕̮̹ͣ̀͘ļ͔̱͙̝̟̜͚͎͕̮̹ͣ̀͘ḭ̢̛͈͍̠̟̪̑̎̈́̑̽͜͡ḭ̢̛͈͍̠̟̪̑̎̈́̑̽͜͡c̖̠̥͔̪̼̑̃̆̓ͫ͗ͩͩ̋c̖̠̥͔̪̼̑̃̆̓ͫ͗ͩͩ̋i̴̸̡̘͇͔̹͂̍̐̀ͬͩ̈͘i̴̸̡̘͇͔̹͂̍̐̀ͬͩ̈͘t̵̵̖̫͙͎̒ͭ̔̃̔ͧͫ̽͝t̵̵̖̫͙͎̒ͭ̔̃̔ͧͫ̽͝y̴̘̱͈̳ͯ̈́̍ͮ̔͊͊̚̚͞y̴̘̱͈̳ͯ̈́̍ͮ̔͊͊̚̚͞ ̛̩̤̪͇̬͕̯̞̙̪̮̀̂̕ ̛̩̤̪͇̬͕̯̞̙̪̮̀̂̕ļ̲̰̞̈̌̿͐̉́̋ͬ͟͟͡ļ̲̰̞̈̌̿͐̉́̋ͬ͟͟͡e̡̧̛̬̣̗̣̰͂̐̂͗͛̋̇e̡̧̛̬̣̗̣̰͂̐̂͗͛̋̇a̡̯͉̠̞ͩͮ̉̓́ͮ̔̆̒͘a̡̯͉̠̞ͩͮ̉̓́ͮ̔̆̒͘v͔ͦ͏͎̪̮̝̟̤́̀͊̈̎͟v͔ͦ͏͎̪̮̝̟̤́̀͊̈̎͟ȩ̪͔̤̺͗ͦ̅̓ͭͤͫ̆ͣ͒ȩ̪͔̤̺͗ͦ̅̓ͭͤͫ̆ͣ͒ ̶̢̤͎̰̝̤͂̔͒ͦͦ͂̊̀ ̶̢̤͎̰̝̤͂̔͒ͦͦ͂̊̀p̛̝̪͚͖̫͕̅̍̊́̓͒̂̃p̛̝̪͚͖̫͕̅̍̊́̓͒̂̃l̴̸͉͎̖͕̦̥̾ͨ̌̑ͣ̕͝l̴̸͉͎̖͕̦̥̾ͨ̌̑ͣ̕͝a̰̩͔̼͔̦̩͒ͪͭ̐͡͏̗ͮa̰̩͔̼͔̦̩͒ͪͭ̐͡͏̗ͮč̵̱͇̲̞̉̆̌̄ͧͫ̑̈́͠č̵̱͇̲̞̉̆̌̄ͧͫ̑̈́͠e̶̛̜̬̯̤͔̓ͤͮͦ̂͐͜͜e̶̛̜̬̯̤͔̓ͤͮͦ̂͐͜͜ ̸̧̼̯͕̼̭ͣͣ̿̑̈̎̽͜ ̸̧̼̯͕̼̭ͣͣ̿̑̈̎̽͜f̴̼̞͇̺̊̎̓̑̔̈́͗̊͘͞f̴̼̞͇̺̊̎̓̑̔̈́͗̊͘͞ő̶̶̧̺̤̜̹̫͎̻̏̉̍ͩő̶̶̧̺̤̜̹̫͎̻̏̉̍ͩr̵̙̱̺̮͙̯̼͐̀͗̾͊͟͝r̵̙̱̺̮͙̯̼͐̀͗̾͊͟͝ ̵̪̥͍̩̱ͨ͗̓̎̓͒̚͜͞ ̵̪̥͍̩̱ͨ͗̓̎̓͒̚͜͞t̪̤͙̥̖̹̣̤͎̞̒́̒̽̃t̪̤͙̥̖̹̣̤͎̞̒́̒̽̃ḥ̵̷̷̭̘͙͓ͩ̓ͪͤ̓ͮ̍ḥ̵̷̷̭̘͙͓ͩ̓ͪͤ̓ͮ̍é̡̬̺͉̻̻̀̀͂̽ͬ̕̕͠é̡̬̺͉̻̻̀̀͂̽ͬ̕̕͠ ̵̱̻̣͙̌͊́ͯ́̐̀́͂̕ ̵̱̻̣͙̌͊́ͯ́̐̀́͂̕f̨̪͈̲̬̟̝͎̀̔̋ͨ̀͡ͅf̨̪͈̲̬̟̝͎̀̔̋ͨ̀͡ͅi̵̫̱̝͒̇̏̃ͭ̂̄̄̊̐͠i̵̫̱̝͒̇̏̃ͭ̂̄̄̊̐͠n̵̷͖̻̦͍̻̑̈́̎̓͑ͪͫ͟n̵̷͖̻̦͍̻̑̈́̎̓͑ͪͫ͟a̗̗̠̫̦̻̹͇ͯͦͫ͗̽ͥ̚a̗̗̠̫̦̻̹͇ͯͦͫ͗̽ͥ̚l̵̨̨͙̜͔̘̗̯͌̋͂̑̄͢l̵̨̨͙̜͔̘̗̯͌̋͂̑̄͢ ̵̷̛̺̳͙̲̥̬̊̌̽̓̇͝ ̵̷̛̺̳͙̲̥̬̊̌̽̓̇͝"̸̨̫̟̤̥͉̮̥̀ͤ̐͊̇̑"̸̨̫̟̤̥͉̮̥̀ͤ̐͊̇̑c̵̭̘͍͇̜ͨ̔̍̆͛͌͂͌͛c̵̭̘͍͇̜ͨ̔̍̆͛͌͂͌͛l̸̷̢̡̫̩̃́͐̆͒ͨ̔̄͟l̸̷̢̡̫̩̃́͐̆͒ͨ̔̄͟è̙͎̝̞̠̹͍́́̅͐͌͘ͅè̙͎̝̞̠̹͍́́̅͐͌͘ͅą̶̢̡̘̦͖̰̌̎͌ͩ́̓ͮą̶̢̡̘̦͖̰̌̎͌ͩ́̓ͮȑ̹̻̦͙̠͂̽͆ͫ͛͟͏̺͡ȑ̹̻̦͙̠͂̽͆ͫ͛͟͏̺͡"̣̞͕̇ͯ̓̽ͪ͑́̍̚͘͘ͅ"̣̞͕̇ͯ̓̽ͪ͑́̍̚͘͘ͅ ̛̩̘̗̜̗̥̂͊ͥ̀ͨͫ̾ͧ ̛̩̘̗̜̗̥̂͊ͥ̀ͨͫ̾ͧe̵̡͚͉̤̯̮͛̎̓ͪ̾̉̆͟e̵̡͚͉̤̯̮͛̎̓ͪ̾̉̆͟l̢̩͓̙͓͍̈̊ͫͣ́̅ͧ͛͞l̢̩͓̙͓͍̈̊ͫͣ́̅ͧ͛͞e̠̱͉̯͔̙͔̓ͩ̃͋͌ͬͭ͋e̠̱͉̯͔̙͔̓ͩ̃͋͌ͬͭ͋m̧̡̛̤͕̻̳̽͛̓̈́ͣ̊̚͟m̧̡̛̤͕̻̳̽͛̓̈́ͣ̊̚͟e̯͎̺͔̼̾͂͐̄ͮ͌̍͑̕ͅe̯͎̺͔̼̾͂͐̄ͮ͌̍͑̕ͅṉ̸͔̩̙̙̹͚̭ͩ͛͗̀̾ͅṉ̸͔̩̙̙̹͚̭ͩ͛͗̀̾ͅt̸̢̧̝͉̺͉̓́̇ͯ̕͠͠͝t̸̢̧̝͉̺͉̓́̇ͯ̕͠͠͝ ̳͔̜̹̘̪̅̋̎̉͆̑ͤ͡͞ ̳͔̜̹̘̪̅̋̎̉͆̑ͤ͡͞a̷̳͓̞̱͈̓́̒̔̆ͩͯ̊͠a̷̳͓̞̱͈̓́̒̔̆ͩͯ̊͠s̷̛͙̘̳͙͓̠̞̫̆̓̚̚͡s̷̛͙̘̳͙͓̠̞̫̆̓̚̚͡ ̷̢̦̘̮̰͕̏̀ͩ̓͂ͦ͟ͅ ̷̢̦̘̮̰͕̏̀ͩ̓͂ͦ͟ͅw̮͔͇͕̝͖ͪ͒̏̇ͪ̇̍ͦ͠w̮͔͇͕̝͖ͪ͒̏̇ͪ̇̍ͦ͠ẹ̗͚̮̭̓̍̐̃̍́̐͘̕͘ẹ̗͚̮̭̓̍̐̃̍́̐͘̕͘l̴̡̩̱̞͛ͤ͑͑͂̀ͣ̉̌̕l̴̡̩̱̞͛ͤ͑͑͂̀ͣ̉̌̕l̷̨̘̤̣̯͇̲̝ͨ̍ͦ͝͝ͅl̷̨̘̤̣̯͇̲̝ͨ̍ͦ͝͝ͅ,̷̻̙̖͔͚͋̇̂̑͗̕̕͢ͅ,̷̻̙̖͔͚͋̇̂̑͗̕̕͢ͅ ̴̶̮̣̪̣̟͚̅͊ͧͭ̂͂̓ ̴̶̮̣̪̣̟͚̅͊ͧͭ̂͂̓h̡͈̗̙͚̳͕̤͍̿̄͑ͥ͊̉h̡͈̗̙͚̳͕̤͍̿̄͑ͥ͊̉e̡̞͔̘͐̋͌̅̓̈͆̇̿͟͠e̡̞͔̘͐̋͌̅̓̈͆̇̿͟͠n̤͕͉̣̐͊́̽̍́͂͏̙̾ͅn̤͕͉̣̐͊́̽̍́͂͏̙̾ͅc̨̧̛̜͈͍͓̣̹ͮͧ̊͟͡ͅc̨̧̛̜͈͍͓̣̹ͮͧ̊͟͡ͅȩ̢̛͚̣͓͙ͣͮͩ̌̌́͟͠ȩ̢̛͚̣͓͙ͣͮͩ̌̌́͟͠ ̷̜̀ͪ̅͐͝͏̤̮̄͑̾ͬ͝ ̷̜̀ͪ̅͐͝͏̤̮̄͑̾ͬ͝t̙͔̳͕̝̝͔͐̊̓ͩ̈́ͪ̒͠t̙͔̳͕̝̝͔͐̊̓ͩ̈́ͪ̒͠h̩̖̪̠͂ͪ́͐̿͊ͨ̈̋̃͟h̩̖̪̠͂ͪ́͐̿͊ͨ̈̋̃͟e̋͆ͬ͞͏̵̘̹̙̂ͥ̐̀́ͅe̋͆ͬ͞͏̵̘̹̙̂ͥ̐̀́ͅ ̧̱͌̆̏͘͏̬̠̹̏ͦ̓͋̕ ̧̱͌̆̏͘͏̬̠̹̏ͦ̓͋̕f̸̧͎̣̪̯̻̗̟̎̎͂ͫ̕͝f̸̧͎̣̪̯̻̗̟̎̎͂ͫ̕͝a̟̓̃͒͏̸̧̣̱̎̽̏̐̓ͤa̟̓̃͒͏̸̧̣̱̎̽̏̐̓ͤć̯͚͕͡͏̴̛̜̺̣͙͉̀̍ć̯͚͕͡͏̴̛̜̺̣͙͉̀̍ț̢̹͇͈ͩ̋́̔̇̉ͤ̽͢ͅț̢̹͇͈ͩ̋́̔̇̉ͤ̽͢ͅo͈̥͊ͦ̔̃ͬ̎͛ͧ͌͌͟͟͝o͈̥͊ͦ̔̃ͬ̎͛ͧ͌͌͟͟͝r̸̨͕̙̟̟͈̼͔ͥͮ͋ͫ͒͝r̸̨͕̙̟̟͈̼͔ͥͮ͋ͫ͒͝ ̧̗̝̘͇͉̩̗̅̊̓͂̐͊͡ ̧̗̝̘͇͉̩̗̅̊̓͂̐͊͡o̬̻̪̹̘̥̳̲̫̳̫̳ͬͩ͊o̬̻̪̹̘̥̳̲̫̳̫̳ͬͩ͊f̡̣̜̗͚̙͇̓͑̍ͬ̅̚͞͞f̡̣̜̗͚̙͇̓͑̍ͬ̅̚͞͞ ̵̸͓̱̻̱̌̃ͫ̑̿͐͂ͨ̇ ̵̸͓̱̻̱̌̃ͫ̑̿͐͂ͨ̇2̡̝̥̯͚͔̖̫ͫ̽̔͑̅̚͞2̡̝̥̯͚͔̖̫ͫ̽̔͑̅̚͞ ̨̠̰̯̤͕̗̗̳͆̑͐͌̕͟ ̨̠̰̯̤͕̗̗̳͆̑͐͌̕͟i͇̫̲̲͓̖͙͖̱ͤ͊̎̃ͧ͢i͇̫̲̲͓̖͙͖̱ͤ͊̎̃ͧ͢n̵̢̻̦̭̏̓̂́͏̲̪̙̏͌n̵̢̻̦̭̏̓̂́͏̲̪̙̏͌ ̸̵̛̹͇͚̓̋̎̏̽̚̚͢͜ ̸̵̛̹͇͚̓̋̎̏̽̚̚͢͜t͈͔̤̲̬ͧͩ̔̀̂́͑̂ͭ͘t͈͔̤̲̬ͧͩ̔̀̂́͑̂ͭ͘h̡̻̙̖̪̱̍͗̍́͗́́̅͠h̡̻̙̖̪̱̍͗̍́͗́́̅͠e̶̖̩̜͐ͥͨͪͣ̆͋̋̉͢͡e̶̖̩̜͐ͥͨͪͣ̆͋̋̉͢͡ ̧͈̙̤͉͌ͩ̓͐̌̄ͦ͌ͥ͝ ̧͈̙̤͉͌ͩ̓͐̌̄ͦ͌ͥ͝c̨̨̹̗̬͕̩̈̑̉̃̑́̆͞c̨̨̹̗̬͕̩̈̑̉̃̑́̆͞h̭͚̦̻̘͈͆ͪ̿̌́̏̐͊͠h̭͚̦̻̘͈͆ͪ̿̌́̏̐͊͠ę̙͍͚ͮͦ́ͭͥ̈͑ͧ̕̕͢ę̙͍͚ͮͦ́ͭͥ̈͑ͧ̕̕͢c̝̭͓̹̙̠̄̍ͦ̌̏̉̇͛ͥc̝̭͓̹̙̠̄̍ͦ̌̏̉̇͛ͥk̶̡͚̦̰̣͖̔͌́̋͋̔ͥ̕k̶̡͚̦̰̣͖̔͌́̋͋̔ͥ̕.̛̱̖͓̼͚̲ͪ̆̈́̃̚͜͞ͅ.̛̱̖͓̼͚̲ͪ̆̈́̃̚͜͞ͅ ̶̴̺̹̜̺͇ͮ̉ͯ͋͗͝͝ͅ ̶̴̺̹̜̺͇ͮ̉ͯ͋͗͝͝ͅA͉̺̰̲̟̺͚͙̽́̀̌ͬͩ͠A͉̺̰̲̟̺͚͙̽́̀̌ͬͩ͠l̜͈̟͖̾͑̈́́̇ͮ̐ͦͮ͋̋l̜͈̟͖̾͑̈́́̇ͮ̐ͦͮ͋̋s̡̛̯̜̩̪̤̹̅͛̋̓͂̊͡s̡̛̯̜̩̪̤̹̅͛̋̓͂̊͡o̶͉̱͉̠̫̻ͤͣ̓ͭ͊͑͆ͅo̶͉̱͉̠̫̻ͤͣ̓ͭ͊͑͆ͅ ̢̗͉̝̞͗͛̊́ͦ͛̍̚͜͡ ̢̗͉̝̞͗͛̊́ͦ͛̍̚͜͡i̵̧͍̝̦̬̭̽̎̈̃̓̚͟͝i̵̧͍̝̦̬̭̽̎̈̃̓̚͟͝f̴̛̻̞̬̟͖̙̦̑́̀̍̇͝f̴̛̻̞̬̟͖̙̦̑́̀̍̇͝ ͓͚͇̺ͪ͛ͦͥ̓̎ͨ͒͊̚͟ ͓͚͇̺ͪ͛ͦͥ̓̎ͨ͒͊̚͟t̶̯͙̹̟͖̂̇͒̾ͭ͒͐͛̌t̶̯͙̹̟͖̂̇͒̾ͭ͒͐͛̌ḧ̠̬́͋̕͏̧̙̼͑͂̀̌̉̈ḧ̠̬́͋̕͏̧̙̼͑͂̀̌̉̈e̫̺͔̗̳͋̒͌ͤͬ̔͗̕̕͡e̫̺͔̗̳͋̒͌ͤͬ̔͗̕̕͡r̴̛̭͙͑́ͤ̓̒͊̈ͥ̑ͮ͞r̴̛̭͙͑́ͤ̓̒͊̈ͥ̑ͮ͞ȇ̷̛̝͓̜̮̩͙ͨ̎̎͛̌̽ȇ̷̛̝͓̜̮̩͙ͨ̎̎͛̌̽ ̸̩̤̘̖̳̻̋̈͛͑̈́̌̒͝ ̸̩̤̘̖̳̻̋̈͛͑̈́̌̒͝i̧͖͕̞̩̱̭̎̽̀͏̮ͬͨ͡i̧͖͕̞̩̱̭̎̽̀͏̮ͬͨ͡ś̶͍̞̉ͯ̊ͦͧ̀̆̌͂͞͝ś̶͍̞̉ͯ̊ͦͧ̀̆̌͂͞͝ ̡̛͙͈̜̗̻̮̞͍̝̝̓̅͋ ̡̛͙͈̜̗̻̮̞͍̝̝̓̅͋ȃ̢͍̟̬̳ͣ͏̝̔͑̎ͣ̕ͅȃ̢͍̟̬̳ͣ͏̝̔͑̎ͣ̕ͅ ̖̼͙̯͎̒͒ͩͣ̀̆͗̇͝ͅ ̖̼͙̯͎̒͒ͩͣ̀̆͗̇͝ͅļ̩̪͕͓͖͌̐͛̊ͫͪ̿͊ͤļ̩̪͕͓͖͌̐͛̊ͫͪ̿͊ͤȍ͍̜͓̣͈͍̳̄͊̄ͣ͢͝ͅȍ͍̜͓̣͈͍̳̄͊̄ͣ͢͝ͅt̵̷̛̤͎͕̖̹ͦ̇͒́͂ͮ͘t̵̷̛̤͎͕̖̹ͦ̇͒́͂ͮ͘ ̶̨̳̺̖̼̯͎̯̬̀̈̐ͦ͜ ̶̨̳̺̖̼̯͎̯̬̀̈̐ͦ͜o̷̡̯̼͇̻͙̙̙͒͂ͩ̉̀ͮo̷̡̯̼͇̻͙̙̙͒͂ͩ̉̀ͮf̻̺̖͉̊ͤ̇ͤ̍͌͛̐͟͟͝f̻̺̖͉̊ͤ̇ͤ̍͌͛̐͟͟͝ ̷̴̟̠̹͎̱̈́̈́̆̈́̇̃͘͞ ̷̴̟̠̹͎̱̈́̈́̆̈́̇̃͘͞p̸̸̧̨̦̪͕̮̀͒͒͌͌̑͢p̸̸̧̨̦̪͕̮̀͒͒͌͌̑͢a̯͙ͥͬ̊̓ͯ͌ͮ͊̎̂͒͢͠a̯͙ͥͬ̊̓ͯ͌ͮ͊̎̂͒͢͠ċ̛̫̱̥͕̳̲ͫͤ̎͐̄̕͠ċ̛̫̱̥͕̳̲ͫͤ̎͐̄̕͠k̵̡̹̲͓̾̉͏̶̻́ͩ̎̓̊k̵̡̹̲͓̾̉͏̶̻́ͩ̎̓̊e̵̡̢̢̪͍̲̣͒̒̍ͯͤ͊͑e̵̡̢̢̪͍̲̣͒̒̍ͯͤ͊͑ḑ̘͖̼̌ͭ̐͑ͯ͋ͬ̈́͆̓̚ḑ̘͖̼̌ͭ̐͑ͯ͋ͬ̈́͆̓̚ ̶̶̧̺̰͖̯͇̏̄̿ͤ̔͘͡ ̶̶̧̺̰͖̯͇̏̄̿ͤ̔͘͡c̩̝̯͂͆ͤ̈́͆̏̑̄ͦ͗̿͞c̩̝̯͂͆ͤ̈́͆̏̑̄ͦ͗̿͞e̥̫͌̓̚͏̵̧͙̣̻̞́̌̉e̥̫͌̓̚͏̵̧͙̣̻̞́̌̉l̵̪̣̪̘̙̟̘͊͒̿̏͗͝͠l̵̪̣̪̘̙̟̘͊͒̿̏͗͝͠l̨̮͚̟̺̹ͮ͊ͭ̊ͮ̿͘͘͟l̨̮͚̟̺̹ͮ͊ͭ̊ͮ̿͘͘͟s̩̯͌̊͒͝͏̥͑̈̎ͥ̀͟͞s̩̯͌̊͒͝͏̥͑̈̎ͥ̀͟͞,̡̙̻̭̪̭̖̀̇̒ͮ̈̒̇̕,̡̙̻̭̪̭̖̀̇̒ͮ̈̒̇̕ ̷̢̫̳̺͉̯̳̂̓ͨ͋͛͂͞ ̷̢̫̳̺͉̯̳̂̓ͨ͋͛͂͞p̟̰͖̹̦̲͙̉̑͐͑͗̀͟͢p̟̰͖̹̦̲͙̉̑͐͑͗̀͟͢á̳̜̈̓͛͠͏̢̄ͧ̉ͧͨͅá̳̜̈̓͛͠͏̢̄ͧ̉ͧͨͅs̵̢̥̖̰̥̼̯ͪͭ̿͗͌ͪ͊s̵̢̥̖̰̥̼̯ͪͭ̿͗͌ͪ͊s̘̱͕̓̅͛̆̅ͮ́̅ͧͣ̈̚s̘̱͕̓̅͛̆̅ͮ́̅ͧͣ̈̚ ̡̮̹̹̗͎̝ͣ̇́ͤ̾ͤ͞ͅ ̡̮̹̹̗͎̝ͣ̇́ͤ̾ͤ͞ͅt̡̛̝̯̱̖̠̱ͤ͒͆̍̚͘ͅt̡̛̝̯̱̖̠̱ͤ͒͆̍̚͘ͅh̛̯̻̩̘̤̳̿̓͂̐͐͡͡͠h̛̯̻̩̘̤̳̿̓͂̐͐͡͡͠ë́͏̩̣̗̺̟ͭ̃̾͂̀͘͢͝ë́͏̩̣̗̺̟ͭ̃̾͂̀͘͢͝m̸̜͔̮̥̹̲̖̲̄̈̊̎ͬ͠m̸̜͔̮̥̹̲̖̲̄̈̊̎ͬ͠ ̝͇̏͏̡̟̥͍ͦ̋̎ͤ̕͢͜ ̝͇̏͏̡̟̥͍ͦ̋̎ͤ̕͢͜ó͖̬̩̤̜̫͔͑̌ͫ̈́͡͏̇ó͖̬̩̤̜̫͔͑̌ͫ̈́͡͏̇f̴̶̴̥͔̗͖̬̆͒ͨ͊ͬͅͅf̴̶̴̥͔̗͖̬̆͒ͨ͊ͬͅͅ ̮̦̲̼̞̑ͨ͒̌ͤ̿́̌͐͒ ̮̦̲̼̞̑ͨ͒̌ͤ̿́̌͐͒t̛̮̰͔̋͂͗̓͋̇̅̆̒͊ͅt̛̮̰͔̋͂͗̓͋̇̅̆̒͊ͅo̴̢͚̮̳͙̟̳̐ͬ͑̃̓͡ͅo̴̢͚̮̳͙̟̳̐ͬ͑̃̓͡ͅ ̝̺͖͒ͯͭ̑ͤ͊ͮ͂̚̚͡ͅ ̝̺͖͒ͯͭ̑ͤ͊ͮ͂̚̚͡ͅt̶̨̲̦͉͖̲̤̗ͬ̋̋ͦ̂ͯt̶̨̲̦͉͖̲̤̗ͬ̋̋ͦ̂ͯh̶̨̤͍̜̯͈͇͛ͩ́̀͊ͮͩh̶̨̤͍̜̯͈͇͛ͩ́̀͊ͮͩe̡̢̤̰̰͙̭͈̓ͯͬ͑ͨ̃͢e̡̢̤̰̰͙̭͈̓ͯͬ͑ͨ̃͢ ̶̛̺̦̯̹̞͎̟̥̞̝̐̕ͅ ̶̛̺̦̯̹̞͎̟̥̞̝̐̕ͅU͙̓ͤ͏̟̗̟͕̥̰́͑̆ͧ͟U͙̓ͤ͏̟̗̟͕̥̰́͑̆ͧ͟I̪̩͕͕̼̎͐ͭͦ͐̋̐̅ͯ͢I̪̩͕͕̼̎͐ͭͦ͐̋̐̅ͯ͢ ̢̦͍̰̬͚ͯ́ͫ̿ͨ͘͘͝͡ ̢̦͍̰̬͚ͯ́ͫ̿ͨ͘͘͝͡t̴̨͉̟̥͛͐̇̀̎̒̄ͧ̀̇t̴̨͉̟̥͛͐̇̀̎̒̄ͧ̀̇o̸͇͏̷͍͉̠ͤ̈̾ͤ͛ͥ̚͝o̸͇͏̷͍͉̠ͤ̈̾ͤ͛ͥ̚͝ ̸̣͕̝̯̼́ͨͯ̏̋̂̑́͘ ̸̣͕̝̯̼́ͨͯ̏̋̂̑́͘l̵̨̛̬̱̣̬͚̺̫̳ͨ̽ͫͯl̵̨̛̬̱̣̬͚̺̫̳ͨ̽ͫͯḙ̳͕̝̥̄̆ͮ̄ͦͨ̓̚͏͢ḙ̳͕̝̥̄̆ͮ̄ͦͨ̓̚͏͢t̵̼̲̣̉̀̌ͭ̒̓͌̀͒̀ͅt̵̼̲̣̉̀̌ͭ̒̓͌̀͒̀ͅ ̺͈͙̘̣̩̙͕̋̇͆̀͊̇̂ ̺͈͙̘̣̩̙͕̋̇͆̀͊̇̂i̧̭̲̼̗̥̪̣̭ͬ͑ͨ̓̈̐i̧̭̲̼̗̥̪̣̭ͬ͑ͨ̓̈̐ṱ̴̯̲̱̫̲̥ͭ̀͋̂̚̕͟ṱ̴̯̲̱̫̲̥ͭ̀͋̂̚̕͟ ̖̗͔̦̲̻̌̀̏͆͊ͤ̑ͨ̉ ̖̗͔̦̲̻̌̀̏͆͊ͤ̑ͨ̉s̨̢͔̄̃ͯ̈́̑͐̚̕͢͝͝s̨̢͔̄̃ͯ̈́̑͐̚̕͢͝͝t͚͉͇̳̘̅̇̋͌̀̋́ͨ́͏t͚͉͇̳̘̅̇̋͌̀̋́ͨ́͏â͇͎̺ͨͭ͡͏͚̯ͤͩ͋ͧ͘â͇͎̺ͨͭ͡͏͚̯ͤͩ͋ͧ͘r̷̘̜͍̫̯ͭͪ͑͗̓͆͟͝ͅr̷̘̜͍̫̯ͭͪ͑͗̓͆͟͝ͅṭ̷̢̱͕̎ͬ̿́́͊̐͟͢͜ṭ̷̢̱͕̎ͬ̿́́͊̐͟͢͜ ̟̥̖͕̭͍̲ͩ̆̒̑͊̕̚͡ ̟̥̖͕̭͍̲ͩ̆̒̑͊̕̚͡p̶̴̨̧̜̰̜̘̉̽ͤ́͘͢͜p̶̴̨̧̜̰̜̘̉̽ͤ́͘͢͜ṙ̠̘̟̭͖̜̜͍ͦ̾͒͜͠͞ṙ̠̘̟̭͖̜̜͍ͦ̾͒͜͠͞ǒ̷̶̫͈̫̹ͬ͂ͧ̿̿̑͂͂ǒ̷̶̫͈̫̹ͬ͂ͧ̿̿̑͂͂c̵̸̮͕̮͈̞̼͎͉͍̑́ͭ̀c̵̸̮͕̮͈̞̼͎͉͍̑́ͭ̀e̸̡͔͓̳̞̟̘ͩ̍̽ͪͤͣ͢e̸̡͔͓̳̞̟̘ͩ̍̽ͪͤͣ͢s̨͍̬̖͂̏ͦ̀ͫ̐ͨͪ͡ͅͅs̨͍̬̖͂̏ͦ̀ͫ̐ͨͪ͡ͅͅs̡̻̹̜͍̺͌͛ͮ̓̀̈́̉̿͑s̡̻̹̜͍̺͌͛ͮ̓̀̈́̉̿͑í̤̜ͭ͢͏̶̶̹͍ͤͪ̉ͫ̋í̤̜ͭ͢͏̶̶̹͍ͤͪ̉ͫ̋ņ̵̼̪̭̲̤͙͖̒̑ͨ͂̌͘ņ̵̼̪̭̲̤͙͖̒̑ͨ͂̌͘g̷̢̢̭̘̙̥̖̲̭͛ͣ́̀̍g̷̢̢̭̘̙̥̖̲̭͛ͣ́̀̍ ̷̺̱̙̹͔̗͆ͪ̾ͬͬ̓͘͠ ̷̺̱̙̹͔̗͆ͪ̾ͬͬ̓͘͠t̛̤̻̲̓̓ͩ̇ͫͫ͆ͦ͛̕͞t̛̤̻̲̓̓ͩ̇ͫͫ͆ͦ͛̕͞ḣ̜̘̮̫͍̗͇ͥͯ̽̕͢͢͝ḣ̜̘̮̫͍̗͇ͥͯ̽̕͢͢͝ẹ̵̱̹͚͖̜̞̆̾͌ͬ̀̿͞ẹ̵̱̹͚͖̜̞̆̾͌ͬ̀̿͞m̶̢̧͉̝̜̝̍͑͂̽̌̉̈́ͩm̶̢̧͉̝̜̝̍͑͂̽̌̉̈́ͩ'
+ api.nvim_buf_set_lines(0, 0, -1, true, { text })
+
+ screen:try_resize(250, 10)
+ screen:expect({
+ grid = [[
+ {100: 1 }{101:^c̯̥̳̮̫̳͔̱̀ͦͩ̄͋̓͘c̯̥̳̮̫̳͔̱̀ͦͩ̄͋̓͘l̶̴̴̨̛͓͚͎̥ͦͤ̑͆͛͢l̶̴̴̨̛͓͚͎̥ͦͤ̑͆͛͢ô̷̤̩ͯͧ͆ͪ̈́́͒̒̐͐̕ô̷̤̩ͯͧ͆ͪ̈́́͒̒̐͐̕s̶̷̢̩̱̠̀ͦ̽ͮ͒ͨ̚͟͠s̶̷̢̩̱̠̀ͦ̽ͮ͒ͨ̚͟͠e͉̯̱̖͕̳̼̽̊̒ͣ̊ͥ̚̚e͉̯̱̖͕̳̼̽̊̒ͣ̊ͥ̚̚ ͇͌̈̄ͬͧͧ͝͠͏̷ͪ̎͟͠ ͇͌̈̄ͬͧͧ͝͠͏̷ͪ̎͟͠t̵̳̅̽͏̵̡̥̲͍͙̹̯ͩ̐t̵̳̅̽͏̵̡̥̲͍͙̹̯ͩ̐o͋͏̬̞̣ͬ́ͬ̎̋̓̽͘͠͡o͋͏̬̞̣ͬ́ͬ̎̋̓̽͘͠͡ ͏̛͙̮̈ͬ̌͐ͤ͒ͧ̎ͤ͜͠ ͏̛͙̮̈ͬ̌͐ͤ͒ͧ̎ͤ͜͠ǫ̛̳͕̦͖̪̀͂͛̅̔ͪ͒͜ǫ̛̳͕̦͖̪̀͂͛̅̔ͪ͒͜v̸̡͖̗̣ͯ̿̔͊̅ͯ̈̓̇ͅv̸̡͖̗̣ͯ̿̔͊̅ͯ̈̓̇ͅe̴̶̢̜̭̠̰̞ͪͨ͂ͤ͆́͗e̴̶̢̜̭̠̰̞ͪͨ͂ͤ͆́͗r̨̖̼̳̳͚̖̒ͯ̊̋̂̑̚͞r̨̖̼̳̳͚̖̒ͯ̊̋̂̑̚͞f̵̮̣̬̾͛̌ͧͦ͘͢͜͜͠ͅf̵̮̣̬̾͛̌ͧͦ͘͢͜͜͠ͅl̡͉̬̳͈̠̏͂ͤ̈ͨ̀ͩ̔͏l̡͉̬̳͈̠̏͂ͤ̈ͨ̀ͩ̔͏ỏ̶̢̻̠͎͇͈̜̈̆ͯ̔ͩ̾ỏ̶̢̻̠͎͇͈̜̈̆ͯ̔ͩ̾ẉ̦̞̼̩̣͙̅̿́̓̉̎̈ͪẉ̦̞̼̩̣͙̅̿́̓̉̎̈ͪi̷̡͍͓͔̝͙͖͖̍ͯͤͬͦ͝i̷̡͍͓͔̝͙͖͖̍ͯͤͬͦ͝n̠̪̰͋ͩ̆͏̶̖̯ͭ̀̿͛͘n̠̪̰͋ͩ̆͏̶̖̯ͭ̀̿͛͘g̴̭͎̞͙̗̯͙͖ͬ́ͧͧ͝ͅg̴̭͎̞͙̗̯͙͖ͬ́ͧͧ͝ͅ ̢͎̬͓̮̹̰̙͍̓̐͋͂͐̚ ̢͎̬͓̮̹̰̙͍̓̐͋͂͐̚ť̴̼̝̗ͩ̍͋̿͏͇ͧ̑̏̚ť̴̼̝̗ͩ̍͋̿͏͇ͧ̑̏̚h̨̨̢͓̲͚͕̦ͨ͛̓ͩ̚͟͠h̨̨̢͓̲͚͕̦ͨ͛̓ͩ̚͟͠ȩ͕̜̥̃̑͋̏͐̎̒͛͊͏͙ȩ͕̜̥̃̑͋̏͐̎̒͛͊͏͙ ̵̨̜̜̠͉̱͎͑ͥ̌͐̽͢͡ ̵̨̜̜̠͉̱͎͑ͥ̌͐̽͢͡r̢̫͓͎̙̭̽ͥͭ͐̂̀̕͟͝r̢̫͓͎̙̭̽ͥͭ͐̂̀̕͟͝e̴̷͓̹̩ͧ́̉̑̈̿ͥ̕͡͝e̴̷͓̹̩ͧ́̉̑̈̿ͥ̕͡͝d̵̡̼̩̠̜͈̯̬͚͛̋̀̆͟d̵̡̼̩̠̜͈̯̬͚͛̋̀̆͟ŕ̻̳̬͏̨̮͚̲ͥ̌͆͗͠ͅŕ̻̳̬͏̨̮͚̲ͥ̌͆͗͠ͅā̸͙̥̤͍͈̣ͪͨ̈͋̈́̈́͜ā̸͙̥̤͍͈̣ͪͨ̈͋̈́̈́͜w̶̦̪͚̤̃ͬ̓͒ͤ̇̇ͮ͢͡w̶̦̪͚̤̃ͬ̓͒ͤ̇̇ͮ͢͡ ̷̡̦̻̻̪͚̳͎ͥ̓ͩͪ͠͝ ̷̡̦̻̻̪͚̳͎ͥ̓ͩͪ͠͝b̳ͮ̒̊̆̒́̈́̏̓͋ͭ̔ͤ̚b̳ͮ̒̊̆̒́̈́̏̓͋ͭ̔ͤ̚u̧̟̫͎͚̭̠͕͂̄̀̒̈̇͜u̧̟̫͎͚̭̠͕͂̄̀̒̈̇͜f̶̸̢͍̑̂̊ͥͫ̈́ͥ͛̈́̃͝f̶̸̢͍̑̂̊ͥͫ̈́ͥ͛̈́̃͝f̵̼̭̮͎ͧ̒̆͊̀ͤ͊̇̕͡f̵̼̭̮͎ͧ̒̆͊̀ͤ͊̇̕͡e̮̪̲̣̞̖͎ͥͤ̐̌̓̐͟͢e̮̪̲̣̞̖͎ͥͤ̐̌̓̐͟͢ŗ̭̘̮̹̖̎̄̆́ͫͭ͢ͅͅŗ̭̘̮̹̖̎̄̆́ͫͭ͢ͅͅ.̪̖͉͚̹̾̉ͮ̔̊ͪ̾̎͟͞.̪̖͉͚̹̾̉ͮ̔̊ͪ̾̎͟͞ ̷̧̺̰͎̣̃͒͗ͮ͑ͪͮ͞ͅ ̷̧̺̰͎̣̃͒͗ͮ͑ͪͮ͞ͅf̛̫͚͚͍̜͎̗̳̂ͬͭ͜͢͝f̛̫͚͚͍̜͎̗̳̂ͬͭ͜͢͝i̴̵̡̛̛͎̤̳̮ͩ̐ͩ͑̇̚i̴̵̡̛̛͎̤̳̮ͩ̐ͩ͑̇̚n̵͇͍͚̖̥̣ͨ̄ͧ̌̂͗͘͝n̵͇͍͚̖̥̣ͨ̄ͧ̌̂͗͘͝ȉ̼̱̫̜̋̓̐͌͆ͨ͘͝͡ͅȉ̼̱̫̜̋̓̐͌͆ͨ͘͝͡ͅs̴̸̝̺̬͚̲̹̘ͪ̆̊ͥ͞͝s̴̸̝̺̬͚̲̹̘ͪ̆̊ͥ͞͝h̴̜̠͇ͦͥ̔̅ͭͭ͋ͩ͟͡͞h̴̜̠͇ͦͥ̔̅ͭͭ͋ͩ͟͡͞ ̶̧̛̻͙̤̘̺̣̻̗͍̓͑͠ ̶̧̛̻͙̤̘̺̣̻̗͍̓͑͠t̠͉̼̬̩͛́ͨ͐̀͛̂ͨ̾͞t̠͉̼̬̩͛́ͨ͐̀͛̂ͨ̾͞h̻̹̝̹̾ͩ̍ͧ͆ͥ̔͘͏̉ͯh̻̹̝̹̾ͩ̍ͧ͆ͥ̔͘͏̉ͯì̷̢̛̺̭͇̟̦̄̓́̓ͪ͟ì̷̢̛̺̭͇̟̦̄̓́̓ͪ͟s̴̡̗͍͕͖̮̟̱̫̎ͣ̀̎̿s̴̡̗͍͕͖̮̟̱̫̎ͣ̀̎̿ ̶͇̟̜̗̗͇͇͐̑̈͋̋̽͟ ̶͇̟̜̗̗͇͇͐̑̈͋̋̽͟e̷̥͙͈̖̤̯̹̯͗̉̈́̽ͨ̕e̷̥͙͈̖̤̯̹̯͗̉̈́̽ͨ̕v̛̝͕̱͙̞̖̒̂̔͆̊̎́ͫv̛̝͕̱͙̞̖̒̂̔͆̊̎́ͫę̴̤̭͖̈̐̿͂ͣ͒̃ͭ̕͟ę̴̤̭͖̈̐̿͂ͣ͒̃ͭ̕͟ṇ̳̭͓̟̠͕̯͑̉ͦ̀ͯ͜͡ṇ̳̭͓̟̠͕̯͑̉ͦ̀ͯ͜͡t̢̞͔̣̄̀͆̂̃ͨͦ͜͜͝͠t̢̞͔̣̄̀͆̂̃ͨͦ͜͜͝͠,̬̳̮͓͉̟͉͓̦͔̑̄ͨ̎͜,̬̳̮͓͉̟͉͓̦͔̑̄ͨ̎͜ ͕͈̠̰̬̬̌͂̏ͥ̀̕̚͢͠ ͕͈̠̰̬̬̌͂̏ͥ̀̕̚͢͠f̺̮̞̈́̏̋͏̺̖̝̓̑̂̚͢f̺̮̞̈́̏̋͏̺̖̝̓̑̂̚͢l̜̪͍̩̩̟͉͓̊̓ͤ̆ͣͫ̌l̜̪͍̩̩̟͉͓̊̓ͤ̆ͣͫ̌u̷̧̞̳̱̜̟̲͑̐͂ͪ͛͘͟u̷̧̞̳̱̜̟̲͑̐͂ͪ͛͘͟s͔͍̽ͣͮ̏̓͛̄ͯ̽͂̐ͯ͜s͔͍̽ͣͮ̏̓͛̄ͯ̽͂̐ͯ͜ḩ̼͕̦͖̼͚̗̃̃ͥ̅̂̈͟ḩ̼͕̦͖̼͚̗̃̃ͥ̅̂̈͟,̵͍̮̮̟͚̝̃ͨ̿ͭ̌ͤ̋̊,̵͍̮̮̟͚̝̃ͨ̿ͭ̌ͤ̋̊ ̷̨̨͈̝̦͂ͦ̒̋̇ͧ̒͟͝ ̷̨̨͈̝̦͂ͦ̒̋̇ͧ̒͟͝a̡̨̲̖̾̂͗̚͢͡͏͈ͤ̉͡a̡̨̲̖̾̂͗̚͢͡͏͈ͤ̉͡nͫͤ̚͜͏̧̛̣̻ͩ̔̍ͦ̕͝nͫͤ̚͜͏̧̛̣̻ͩ̔̍ͦ̕͝d͈̻̗̼̀͡͏̶̵̟̹̻̎̾ͯd͈̻̗̼̀͡͏̶̵̟̹̻̎̾ͯ ̶͙͈̠̜̬̺͛̀̊̂ͪ̔ͮ͑ ̶͙͈̠̜̬̺͛̀̊̂ͪ̔ͮ͑ş̧̡̢͓̠͋ͫ͑͒͊̅̔͜͞ş̧̡̢͓̠͋ͫ͑͒͊̅̔͜͞t̤̭͓̰̣̉̔̎ͫ͛ͦ̑̕͟͞t̤̭͓̰̣̉̔̎ͫ͛ͦ̑̕͟͞a̠͇͇̯̥͍͚̳̒́͐͐̏͋̓a̠͇͇̯̥͍͚̳̒́͐͐̏͋̓r͉͈̻̻͕̩̩̃̅͋͆ͮ͢͢͡r͉͈̻̻͕̩̩̃̅͋͆ͮ͢͢͡t̵̛̝̗̥̙̟̆ͮ̽̏ͧ͜͠ͅt̵̛̝̗̥̙̟̆ͮ̽̏ͧ͜͠ͅ ̷̼͎̦ͫ̈͑̃̽͏̲̪ͣͯ̽ ̷̼͎̦ͫ̈͑̃̽͏̲̪ͣͯ̽á̸̷̴̟̣́̔̌͏̶͕͋ͭͭá̸̷̴̟̣́̔̌͏̶͕͋ͭͭ ̧̧̲͍̘̘͚͔͇͙ͨͬ́̊ͅ ̧̧̲͍̘̘͚͔͇͙ͨͬ́̊ͅn̸̸̩͖͔͚͚̖͗ͦ̓̀̀̈́̈́n̸̸̩͖͔͚͚̖͗ͦ̓̀̀̈́̈́ę̵̧̬̣̦̖̝̹̱͌̃̑ͣ̚ę̵̧̬̣̦̖̝̹̱͌̃̑ͣ̚w͍̥͚̺ͮ̓̈̈́̾̊̆́̚͜͝w͍̥͚̺ͮ̓̈̈́̾̊̆́̚͜͝ ̛̹̲̥̝͙̾ͨ̆̎̃̋͂̓̕ ̛̹̲̥̝͙̾ͨ̆̎̃̋͂̓̕"̴̜̰̰̱̖̙̘̈́͌ͨͪ̐̕͠"̴̜̰̰̱̖̙̘̈́͌ͨͪ̐̕͠g̸̛͇̐͊͂̽͢͏͖̣ͫ͊ͯͅg̸̛͇̐͊͂̽͢͏͖̣ͫ͊ͯͅr̴̨̲͎̹͇̠̐ͤ̇̒ͬ̆ͧ͞r̴̨̲͎̹͇̠̐ͤ̇̒ͬ̆ͧ͞į̝̱̩͔̈ͨ̉͌̋̍̂͜͟͞į̝̱̩͔̈ͨ̉͌̋̍̂͜͟͞d̷̴̷̟̎͌͑͛̈́ͭͨͯ̋ͭ̕d̷̴̷̟̎͌͑͛̈́ͭͨͯ̋ͭ̕_̢̭̙̦̪͇̾̔̆ͬͦ́ͥ͢͡_̢̭̙̦̪͇̾̔̆ͬͦ́ͥ͢͡l̡̢̨̧͔̱̥̹̬̆ͮ̈́̏̅͜l̡̢̨̧͔̱̥̹̬̆ͮ̈́̏̅͜ĩ̢͖̠̩̞͚̰̰̉̋̌͛ͪ͠ĩ̢͖̠̩̞͚̰̰̉̋̌͛ͪ͠n̢̬̜̘̲͉ͮ͆͏̯͕ͭͦ̉̅n̢̬̜̘̲͉ͮ͆͏̯͕ͭͦ̉̅ē̡͈̮̭̰̜͍̗̮͔͌͐͆ͫē̡͈̮̭̰̜͍̗̮͔͌͐͆ͫ"̦̠̟ͣ̽͋͐ͧ̓̂̆̎͒͝ͅ"̦̠̟ͣ̽͋͐ͧ̓̂̆̎͒͝ͅ ̴̡̺̹̖̰̀ͤ͊̊͗̊́͜͠ ̴̡̺̹̖̰̀ͤ͊̊͗̊́͜͠ẻ͎̳̻̯̹͓͊̌̄͑͂̉͜͢ẻ͎̳̻̯̹͓͊̌̄͑͂̉͜͢v̞̬̪̥͖ͤ͐̍́ͤ̇̀̕̕ͅv̞̬̪̥͖ͤ͐̍́ͤ̇̀̕̕ͅȇ̶̱̗̩̠͚͎͊ͤͪͦͫ̂̚ȇ̶̱̗̩̠͚͎͊ͤͪͦͫ̂̚n̢̮̜͉̎ͨͩ̒̓ͬͨ̓ͦ͘͜n̢̮̜͉̎ͨͩ̒̓ͬͨ̓ͦ͘͜t̢͚͉̹͇̺̭ͪ̄̉ͨ̄͐̕ͅt̢͚͉̹͇̺̭ͪ̄̉ͨ̄͐̕ͅ ̵̛̳̱͍̩͓ͣ͋̈́͐ͭͧ̿ͅ ̵̛̳̱͍̩͓ͣ͋̈́͐ͭͧ̿ͅã̰̪̙͉̪͇ͣ͋ͤ̓͋͑̕͘ã̰̪̙͉̪͇ͣ͋ͤ̓͋͑̕͘t̴̴̡̡̛̳̼̻̳̂̽͒̇̚͠t̴̴̡̡̛̳̼̻̳̂̽͒̇̚͠ ̴̙̤̹͔̳̟̽̀̆ͥ̂̕͘͝ ̴̙̤̹͔̳̟̽̀̆ͥ̂̕͘͝t̴͖̼͔̬̦̏ͩ̄́̓̊̔̇͡t̴͖̼͔̬̦̏ͩ̄́̓̊̔̇͡ḫ̷͚͇̫̫̠͒ͮ̍ͣ̃͐͐̍ḫ̷͚͇̫̫̠͒ͮ̍ͣ̃͐͐̍e̳͉̮͖̳̣̎͌̂ͣ͋ͯ̆͜͞e̳͉̮͖̳̣̎͌̂ͣ͋ͯ̆͜͞ ̪̖̉̌̀̽̄̍̓̀̂̋͐̈̚ ̪̖̉̌̀̽̄̍̓̀̂̋͐̈̚c̶̫̜͚̊̿̂̿ͥͭ̓̂̈́͘͡c̶̫̜͚̊̿̂̿ͥͭ̓̂̈́͘͡ṷ̵̷͉̯̜̬̝̑͛ͤ̋ͧͯ̉ṷ̵̷͉̯̜̬̝̑͛ͤ̋ͧͯ̉ŗ̙̬̺̬ͥͤ̓͐̈́ͬ̽̌͡͡ŗ̙̬̺̬ͥͤ̓͐̈́ͬ̽̌͡͡r̛͖̼̣͙̋̇̀̅͒̽ͥ̑ͅͅr̛͖̼̣͙̋̇̀̅͒̽ͥ̑ͅͅě̢̪̦̼͘͏̴̠̞͍̓̐ͭ̇ě̢̪̦̼͘͏̴̠̞͍̓̐ͭ̇ǹ̨̨̛̛̯̍ͭͫ̎̍̃̄̐̍ǹ̨̨̛̛̯̍ͭͫ̎̍̃̄̐̍t̵̳͔̭̮̭̱̰ͤ͐̉̾͗̅͢t̵̳͔̭̮̭̱̰ͤ͐̉̾͗̅͢ ̩͕ͧ̌͂͂́ͫͥ̍͏̬̙͗ͅ ̩͕ͧ̌͂͂́ͫͥ̍͏̬̙͗ͅp̞̞͇͇̯̩̬̜ͥ̃͐̑͋́͗p̞̞͇͇̯̩̬̜ͥ̃͐̑͋́͗o̵͖͈̩̪̥̝̊̒̉̿͋ͩ̆͠o̵͖͈̩̪̥̝̊̒̉̿͋ͩ̆͠s̶͇̺̩̟̺͋̆̒ͫͥ̆͏͔͜s̶͇̺̩̟̺͋̆̒ͫͥ̆͏͔͜i̞̝̭̲͈̝̮̫͚͑̓ͤ̎ͮ̀i̞̝̭̲͈̝̮̫͚͑̓ͤ̎ͮ̀t̷̬͇̗̥̳͔̮͔̎̀ͣ̊̕͢t̷̬͇̗̥̳͔̮͔̎̀ͣ̊̕͢i̶̧̗̠̗̲͑̋ͣͪͦͣ͆̕͢i̶̧̗̠̗̲͑̋ͣͪͦͣ͆̕͢ǫ̰̟̙ͯ͏̬̦͚̝̀̈́ͣ͘͜ǫ̰̟̙ͯ͏̬̦͚̝̀̈́ͣ͘͜n̸̻̩͖͓̠̲̮̐̄̌̇́́͠n̸̻̩͖͓̠̲̮̐̄̌̇́́͠}|
+ {100: }{101:.̧̛͈̙̭̉ͥ̋͛̏͋̂̿͛͞.̧̛͈̙̭̉ͥ̋͛̏͋̂̿͛͞ ̡̲͇̳͔̦̤̹̥ͣ̍ͪͮ̎͡ ̡̲͇̳͔̦̤̹̥ͣ̍ͪͮ̎͡F̼̣͙̳̞͑͒ͧͣ̔̊̇̓̈́͠F̼̣͙̳̞͑͒ͧͣ̔̊̇̓̈́͠ŏ̸̶͎̘̟͙̤̑̒̿͗͛̐̚ŏ̸̶͎̘̟͙̤̑̒̿͗͛̐̚r̵̰͇͚̥̻͚̈́̌̽ͨͥ̕͘͞r̵̰͇͚̥̻͚̈́̌̽ͨͥ̕͘͞ ̵̶̧͖̙̝̻̭̤̒̿͌͗͑͡ ̵̶̧͖̙̝̻̭̤̒̿͌͗͑͡ś̸̬̘̭̼͓̹ͥ͛ͪ̐̈́͆͝ś̸̬̘̭̼͓̹ͥ͛ͪ̐̈́͆͝i͎̺̪̖̻ͫ̀ͤ̾ͦ̽ͭ͒̒͘i͎̺̪̖̻ͫ̀ͤ̾ͦ̽ͭ͒̒͘m̨̩͎̫̫̙̃̈͆ͬ̊͠͏̽͞m̨̩͎̫̫̙̃̈͆ͬ̊͠͏̽͞p̴̢̨͖̼͍̲͍̲ͩ̊̒̌̃ͤp̴̢̨͖̼͍̲͍̲ͩ̊̒̌̃ͤļ͔̱͙̝̟̜͚͎͕̮̹ͣ̀͘ļ͔̱͙̝̟̜͚͎͕̮̹ͣ̀͘ḭ̢̛͈͍̠̟̪̑̎̈́̑̽͜͡ḭ̢̛͈͍̠̟̪̑̎̈́̑̽͜͡c̖̠̥͔̪̼̑̃̆̓ͫ͗ͩͩ̋c̖̠̥͔̪̼̑̃̆̓ͫ͗ͩͩ̋i̴̸̡̘͇͔̹͂̍̐̀ͬͩ̈͘i̴̸̡̘͇͔̹͂̍̐̀ͬͩ̈͘t̵̵̖̫͙͎̒ͭ̔̃̔ͧͫ̽͝t̵̵̖̫͙͎̒ͭ̔̃̔ͧͫ̽͝y̴̘̱͈̳ͯ̈́̍ͮ̔͊͊̚̚͞y̴̘̱͈̳ͯ̈́̍ͮ̔͊͊̚̚͞ ̛̩̤̪͇̬͕̯̞̙̪̮̀̂̕ ̛̩̤̪͇̬͕̯̞̙̪̮̀̂̕ļ̲̰̞̈̌̿͐̉́̋ͬ͟͟͡ļ̲̰̞̈̌̿͐̉́̋ͬ͟͟͡e̡̧̛̬̣̗̣̰͂̐̂͗͛̋̇e̡̧̛̬̣̗̣̰͂̐̂͗͛̋̇a̡̯͉̠̞ͩͮ̉̓́ͮ̔̆̒͘a̡̯͉̠̞ͩͮ̉̓́ͮ̔̆̒͘v͔ͦ͏͎̪̮̝̟̤́̀͊̈̎͟v͔ͦ͏͎̪̮̝̟̤́̀͊̈̎͟ȩ̪͔̤̺͗ͦ̅̓ͭͤͫ̆ͣ͒ȩ̪͔̤̺͗ͦ̅̓ͭͤͫ̆ͣ͒ ̶̢̤͎̰̝̤͂̔͒ͦͦ͂̊̀ ̶̢̤͎̰̝̤͂̔͒ͦͦ͂̊̀p̛̝̪͚͖̫͕̅̍̊́̓͒̂̃p̛̝̪͚͖̫͕̅̍̊́̓͒̂̃l̴̸͉͎̖͕̦̥̾ͨ̌̑ͣ̕͝l̴̸͉͎̖͕̦̥̾ͨ̌̑ͣ̕͝a̰̩͔̼͔̦̩͒ͪͭ̐͡͏̗ͮa̰̩͔̼͔̦̩͒ͪͭ̐͡͏̗ͮč̵̱͇̲̞̉̆̌̄ͧͫ̑̈́͠č̵̱͇̲̞̉̆̌̄ͧͫ̑̈́͠e̶̛̜̬̯̤͔̓ͤͮͦ̂͐͜͜e̶̛̜̬̯̤͔̓ͤͮͦ̂͐͜͜ ̸̧̼̯͕̼̭ͣͣ̿̑̈̎̽͜ ̸̧̼̯͕̼̭ͣͣ̿̑̈̎̽͜f̴̼̞͇̺̊̎̓̑̔̈́͗̊͘͞f̴̼̞͇̺̊̎̓̑̔̈́͗̊͘͞ő̶̶̧̺̤̜̹̫͎̻̏̉̍ͩő̶̶̧̺̤̜̹̫͎̻̏̉̍ͩr̵̙̱̺̮͙̯̼͐̀͗̾͊͟͝r̵̙̱̺̮͙̯̼͐̀͗̾͊͟͝ ̵̪̥͍̩̱ͨ͗̓̎̓͒̚͜͞ ̵̪̥͍̩̱ͨ͗̓̎̓͒̚͜͞t̪̤͙̥̖̹̣̤͎̞̒́̒̽̃t̪̤͙̥̖̹̣̤͎̞̒́̒̽̃ḥ̵̷̷̭̘͙͓ͩ̓ͪͤ̓ͮ̍ḥ̵̷̷̭̘͙͓ͩ̓ͪͤ̓ͮ̍é̡̬̺͉̻̻̀̀͂̽ͬ̕̕͠é̡̬̺͉̻̻̀̀͂̽ͬ̕̕͠ ̵̱̻̣͙̌͊́ͯ́̐̀́͂̕ ̵̱̻̣͙̌͊́ͯ́̐̀́͂̕f̨̪͈̲̬̟̝͎̀̔̋ͨ̀͡ͅf̨̪͈̲̬̟̝͎̀̔̋ͨ̀͡ͅi̵̫̱̝͒̇̏̃ͭ̂̄̄̊̐͠i̵̫̱̝͒̇̏̃ͭ̂̄̄̊̐͠n̵̷͖̻̦͍̻̑̈́̎̓͑ͪͫ͟n̵̷͖̻̦͍̻̑̈́̎̓͑ͪͫ͟a̗̗̠̫̦̻̹͇ͯͦͫ͗̽ͥ̚a̗̗̠̫̦̻̹͇ͯͦͫ͗̽ͥ̚l̵̨̨͙̜͔̘̗̯͌̋͂̑̄͢l̵̨̨͙̜͔̘̗̯͌̋͂̑̄͢ ̵̷̛̺̳͙̲̥̬̊̌̽̓̇͝ ̵̷̛̺̳͙̲̥̬̊̌̽̓̇͝"̸̨̫̟̤̥͉̮̥̀ͤ̐͊̇̑"̸̨̫̟̤̥͉̮̥̀ͤ̐͊̇̑c̵̭̘͍͇̜ͨ̔̍̆͛͌͂͌͛c̵̭̘͍͇̜ͨ̔̍̆͛͌͂͌͛l̸̷̢̡̫̩̃́͐̆͒ͨ̔̄͟l̸̷̢̡̫̩̃́͐̆͒ͨ̔̄͟è̙͎̝̞̠̹͍́́̅͐͌͘ͅè̙͎̝̞̠̹͍́́̅͐͌͘ͅą̶̢̡̘̦͖̰̌̎͌ͩ́̓ͮą̶̢̡̘̦͖̰̌̎͌ͩ́̓ͮȑ̹̻̦͙̠͂̽͆ͫ͛͟͏̺͡ȑ̹̻̦͙̠͂̽͆ͫ͛͟͏̺͡"̣̞͕̇ͯ̓̽ͪ͑́̍̚͘͘ͅ"̣̞͕̇ͯ̓̽ͪ͑́̍̚͘͘ͅ ̛̩̘̗̜̗̥̂͊ͥ̀ͨͫ̾ͧ ̛̩̘̗̜̗̥̂͊ͥ̀ͨͫ̾ͧe̵̡͚͉̤̯̮͛̎̓ͪ̾̉̆͟e̵̡͚͉̤̯̮͛̎̓ͪ̾̉̆͟l̢̩͓̙͓͍̈̊ͫͣ́̅ͧ͛͞l̢̩͓̙͓͍̈̊ͫͣ́̅ͧ͛͞e̠̱͉̯͔̙͔̓ͩ̃͋͌ͬͭ͋e̠̱͉̯͔̙͔̓ͩ̃͋͌ͬͭ͋m̧̡̛̤͕̻̳̽͛̓̈́ͣ̊̚͟m̧̡̛̤͕̻̳̽͛̓̈́ͣ̊̚͟e̯͎̺͔̼̾͂͐̄ͮ͌̍͑̕ͅe̯͎̺͔̼̾͂͐̄ͮ͌̍͑̕ͅṉ̸͔̩̙̙̹͚̭ͩ͛͗̀̾ͅṉ̸͔̩̙̙̹͚̭ͩ͛͗̀̾ͅt̸̢̧̝͉̺͉̓́̇ͯ̕͠͠͝t̸̢̧̝͉̺͉̓́̇ͯ̕͠͠͝ ̳͔̜̹̘̪̅̋̎̉͆̑ͤ͡͞ ̳͔̜̹̘̪̅̋̎̉͆̑ͤ͡͞a̷̳͓̞̱͈̓́̒̔̆ͩͯ̊͠a̷̳͓̞̱͈̓́̒̔̆ͩͯ̊͠s̷̛͙̘̳͙͓̠̞̫̆̓̚̚͡s̷̛͙̘̳͙͓̠̞̫̆̓̚̚͡ ̷̢̦̘̮̰͕̏̀ͩ̓͂ͦ͟ͅ ̷̢̦̘̮̰͕̏̀ͩ̓͂ͦ͟ͅw̮͔͇͕̝͖ͪ͒̏̇ͪ̇̍ͦ͠w̮͔͇͕̝͖ͪ͒̏̇ͪ̇̍ͦ͠ẹ̗͚̮̭̓̍̐̃̍́̐͘̕͘ẹ̗͚̮̭̓̍̐̃̍́̐͘̕͘l̴̡̩̱̞͛ͤ͑͑͂̀ͣ̉̌̕l̴̡̩̱̞͛ͤ͑͑͂̀ͣ̉̌̕l̷̨̘̤̣̯͇̲̝ͨ̍ͦ͝͝ͅl̷̨̘̤̣̯͇̲̝ͨ̍ͦ͝͝ͅ,̷̻̙̖͔͚͋̇̂̑͗̕̕͢ͅ,̷̻̙̖͔͚͋̇̂̑͗̕̕͢ͅ ̴̶̮̣̪̣̟͚̅͊ͧͭ̂͂̓ ̴̶̮̣̪̣̟͚̅͊ͧͭ̂͂̓h̡͈̗̙͚̳͕̤͍̿̄͑ͥ͊̉h̡͈̗̙͚̳͕̤͍̿̄͑ͥ͊̉e̡̞͔̘͐̋͌̅̓̈͆̇̿͟͠e̡̞͔̘͐̋͌̅̓̈͆̇̿͟͠n̤͕͉̣̐͊́̽̍́͂͏̙̾ͅn̤͕͉̣̐͊́̽̍́͂͏̙̾ͅc̨̧̛̜͈͍͓̣̹ͮͧ̊͟͡ͅc̨̧̛̜͈͍͓̣̹ͮͧ̊͟͡ͅȩ̢̛͚̣͓͙ͣͮͩ̌̌́͟͠ȩ̢̛͚̣͓͙ͣͮͩ̌̌́͟͠ ̷̜̀ͪ̅͐͝͏̤̮̄͑̾ͬ͝ ̷̜̀ͪ̅͐͝͏̤̮̄͑̾ͬ͝t̙͔̳͕̝̝͔͐̊̓ͩ̈́ͪ̒͠t̙͔̳͕̝̝͔͐̊̓ͩ̈́ͪ̒͠h̩̖̪̠͂ͪ́͐̿͊ͨ̈̋̃͟h̩̖̪̠͂ͪ́͐̿͊ͨ̈̋̃͟e̋͆ͬ͞͏̵̘̹̙̂ͥ̐̀́ͅe̋͆ͬ͞͏̵̘̹̙̂ͥ̐̀́ͅ ̧̱͌̆̏͘͏̬̠̹̏ͦ̓͋̕ ̧̱͌̆̏͘͏̬̠̹̏ͦ̓͋̕f̸̧͎̣̪̯̻̗̟̎̎͂ͫ̕͝f̸̧͎̣̪̯̻̗̟̎̎͂ͫ̕͝a̟̓̃͒͏̸̧̣̱̎̽̏̐̓ͤa̟̓̃͒͏̸̧̣̱̎̽̏̐̓ͤć̯͚͕͡͏̴̛̜̺̣͙͉̀̍ć̯͚͕͡͏̴̛̜̺̣͙͉̀̍ț̢̹͇͈ͩ̋́̔̇̉ͤ̽͢ͅț̢̹͇͈ͩ̋́̔̇̉ͤ̽͢ͅo͈̥͊ͦ̔̃ͬ̎͛ͧ͌͌͟͟͝o͈̥͊ͦ̔̃ͬ̎͛ͧ͌͌͟͟͝r̸̨͕̙̟̟͈̼͔ͥͮ͋ͫ͒͝r̸̨͕̙̟̟͈̼͔ͥͮ͋ͫ͒͝ ̧̗̝̘͇͉̩̗̅̊̓͂̐͊͡ ̧̗̝̘͇͉̩̗̅̊̓͂̐͊͡o̬̻̪̹̘̥̳̲̫̳̫̳ͬͩ͊o̬̻̪̹̘̥̳̲̫̳̫̳ͬͩ͊f̡̣̜̗͚̙͇̓͑̍ͬ̅̚͞͞f̡̣̜̗͚̙͇̓͑̍ͬ̅̚͞͞ ̵̸͓̱̻̱̌̃ͫ̑̿͐͂ͨ̇ ̵̸͓̱̻̱̌̃ͫ̑̿͐͂ͨ̇2̡̝̥̯͚͔̖̫ͫ̽̔͑̅̚͞2̡̝̥̯͚͔̖̫ͫ̽̔͑̅̚͞ ̨̠̰̯̤͕̗̗̳͆̑͐͌̕͟ ̨̠̰̯̤͕̗̗̳͆̑͐͌̕͟i͇̫̲̲͓̖͙͖̱ͤ͊̎̃ͧ͢i͇̫̲̲͓̖͙͖̱ͤ͊̎̃ͧ͢n̵̢̻̦̭̏̓̂́͏̲̪̙̏͌n̵̢̻̦̭̏̓̂́͏̲̪̙̏͌ ̸̵̛̹͇͚̓̋̎̏̽̚̚͢͜ ̸̵̛̹͇͚̓̋̎̏̽̚̚͢͜t͈͔̤̲̬ͧͩ̔̀̂́͑̂ͭ͘t͈͔̤̲̬ͧͩ̔̀̂́͑̂ͭ͘h̡̻̙̖̪̱̍͗̍́͗́́̅͠h̡̻̙̖̪̱̍͗̍́͗́́̅͠e̶̖̩̜͐ͥͨͪͣ̆͋̋̉͢͡e̶̖̩̜͐ͥͨͪͣ̆͋̋̉͢͡ ̧͈̙̤͉͌ͩ̓͐̌̄ͦ͌ͥ͝ ̧͈̙̤͉͌ͩ̓͐̌̄ͦ͌ͥ͝c̨̨̹̗̬͕̩̈̑̉̃̑́̆͞c̨̨̹̗̬͕̩̈̑̉̃̑́̆͞h̭͚̦̻̘͈͆ͪ̿̌́̏̐͊͠h̭͚̦̻̘͈͆ͪ̿̌́̏̐͊͠ę̙͍͚ͮͦ́ͭͥ̈͑ͧ̕̕͢ę̙͍͚ͮͦ́ͭͥ̈͑ͧ̕̕͢c̝̭͓̹̙̠̄̍ͦ̌̏̉̇͛ͥc̝̭͓̹̙̠̄̍ͦ̌̏̉̇͛ͥk̶̡͚̦̰̣͖̔͌́̋͋̔ͥ̕k̶̡͚̦̰̣͖̔͌́̋͋̔ͥ̕.̛̱̖͓̼͚̲ͪ̆̈́̃̚͜͞ͅ.̛̱̖͓̼͚̲ͪ̆̈́̃̚͜͞ͅ ̶̴̺̹̜̺͇ͮ̉ͯ͋͗͝͝ͅ ̶̴̺̹̜̺͇ͮ̉ͯ͋͗͝͝ͅA͉̺̰̲̟̺͚͙̽́̀̌ͬͩ͠A͉̺̰̲̟̺͚͙̽́̀̌ͬͩ͠l̜͈̟͖̾͑̈́́̇ͮ̐ͦͮ͋̋l̜͈̟͖̾͑̈́́̇ͮ̐ͦͮ͋̋s̡̛̯̜̩̪̤̹̅͛̋̓͂̊͡s̡̛̯̜̩̪̤̹̅͛̋̓͂̊͡o̶͉̱͉̠̫̻ͤͣ̓ͭ͊͑͆ͅo̶͉̱͉̠̫̻ͤͣ̓ͭ͊͑͆ͅ ̢̗͉̝̞͗͛̊́ͦ͛̍̚͜͡ ̢̗͉̝̞͗͛̊́ͦ͛̍̚͜͡i̵̧͍̝̦̬̭̽̎̈̃̓̚͟͝i̵̧͍̝̦̬̭̽̎̈̃̓̚͟͝f̴̛̻̞̬̟͖̙̦̑́̀̍̇͝f̴̛̻̞̬̟͖̙̦̑́̀̍̇͝ ͓͚͇̺ͪ͛ͦͥ̓̎ͨ͒͊̚͟ ͓͚͇̺ͪ͛ͦͥ̓̎ͨ͒͊̚͟t̶̯͙̹̟͖̂̇͒̾ͭ͒͐͛̌t̶̯͙̹̟͖̂̇͒̾ͭ͒͐͛̌ḧ̠̬́͋̕͏̧̙̼͑͂̀̌̉̈ḧ̠̬́͋̕͏̧̙̼͑͂̀̌̉̈e̫̺͔̗̳͋̒͌ͤͬ̔͗̕̕͡e̫̺͔̗̳͋̒͌ͤͬ̔͗̕̕͡r̴̛̭͙͑́ͤ̓̒͊̈ͥ̑ͮ͞r̴̛̭͙͑́ͤ̓̒͊̈ͥ̑ͮ͞ȇ̷̛̝͓̜̮̩͙ͨ̎̎͛̌̽ȇ̷̛̝͓̜̮̩͙ͨ̎̎͛̌̽ ̸̩̤̘̖̳̻̋̈͛͑̈́̌̒͝ ̸̩̤̘̖̳̻̋̈͛͑̈́̌̒͝i̧͖͕̞̩̱̭̎̽̀͏̮ͬͨ͡i̧͖͕̞̩̱̭̎̽̀͏̮ͬͨ͡ś̶͍̞̉ͯ̊ͦͧ̀̆̌͂͞͝ś̶͍̞̉ͯ̊ͦͧ̀̆̌͂͞͝ ̡̛͙͈̜̗̻̮̞͍̝̝̓̅͋ ̡̛͙͈̜̗̻̮̞͍̝̝̓̅͋ȃ̢͍̟̬̳ͣ͏̝̔͑̎ͣ̕ͅȃ̢͍̟̬̳ͣ͏̝̔͑̎ͣ̕ͅ ̖̼͙̯͎̒͒ͩͣ̀̆͗̇͝ͅ ̖̼͙̯͎̒͒ͩͣ̀̆͗̇͝ͅ}|
+ {100: }{101:ļ̩̪͕͓͖͌̐͛̊ͫͪ̿͊ͤļ̩̪͕͓͖͌̐͛̊ͫͪ̿͊ͤȍ͍̜͓̣͈͍̳̄͊̄ͣ͢͝ͅȍ͍̜͓̣͈͍̳̄͊̄ͣ͢͝ͅt̵̷̛̤͎͕̖̹ͦ̇͒́͂ͮ͘t̵̷̛̤͎͕̖̹ͦ̇͒́͂ͮ͘ ̶̨̳̺̖̼̯͎̯̬̀̈̐ͦ͜ ̶̨̳̺̖̼̯͎̯̬̀̈̐ͦ͜o̷̡̯̼͇̻͙̙̙͒͂ͩ̉̀ͮo̷̡̯̼͇̻͙̙̙͒͂ͩ̉̀ͮf̻̺̖͉̊ͤ̇ͤ̍͌͛̐͟͟͝f̻̺̖͉̊ͤ̇ͤ̍͌͛̐͟͟͝ ̷̴̟̠̹͎̱̈́̈́̆̈́̇̃͘͞ ̷̴̟̠̹͎̱̈́̈́̆̈́̇̃͘͞p̸̸̧̨̦̪͕̮̀͒͒͌͌̑͢p̸̸̧̨̦̪͕̮̀͒͒͌͌̑͢a̯͙ͥͬ̊̓ͯ͌ͮ͊̎̂͒͢͠a̯͙ͥͬ̊̓ͯ͌ͮ͊̎̂͒͢͠ċ̛̫̱̥͕̳̲ͫͤ̎͐̄̕͠ċ̛̫̱̥͕̳̲ͫͤ̎͐̄̕͠k̵̡̹̲͓̾̉͏̶̻́ͩ̎̓̊k̵̡̹̲͓̾̉͏̶̻́ͩ̎̓̊e̵̡̢̢̪͍̲̣͒̒̍ͯͤ͊͑e̵̡̢̢̪͍̲̣͒̒̍ͯͤ͊͑ḑ̘͖̼̌ͭ̐͑ͯ͋ͬ̈́͆̓̚ḑ̘͖̼̌ͭ̐͑ͯ͋ͬ̈́͆̓̚ ̶̶̧̺̰͖̯͇̏̄̿ͤ̔͘͡ ̶̶̧̺̰͖̯͇̏̄̿ͤ̔͘͡c̩̝̯͂͆ͤ̈́͆̏̑̄ͦ͗̿͞c̩̝̯͂͆ͤ̈́͆̏̑̄ͦ͗̿͞e̥̫͌̓̚͏̵̧͙̣̻̞́̌̉e̥̫͌̓̚͏̵̧͙̣̻̞́̌̉l̵̪̣̪̘̙̟̘͊͒̿̏͗͝͠l̵̪̣̪̘̙̟̘͊͒̿̏͗͝͠l̨̮͚̟̺̹ͮ͊ͭ̊ͮ̿͘͘͟l̨̮͚̟̺̹ͮ͊ͭ̊ͮ̿͘͘͟s̩̯͌̊͒͝͏̥͑̈̎ͥ̀͟͞s̩̯͌̊͒͝͏̥͑̈̎ͥ̀͟͞,̡̙̻̭̪̭̖̀̇̒ͮ̈̒̇̕,̡̙̻̭̪̭̖̀̇̒ͮ̈̒̇̕ ̷̢̫̳̺͉̯̳̂̓ͨ͋͛͂͞ ̷̢̫̳̺͉̯̳̂̓ͨ͋͛͂͞p̟̰͖̹̦̲͙̉̑͐͑͗̀͟͢p̟̰͖̹̦̲͙̉̑͐͑͗̀͟͢á̳̜̈̓͛͠͏̢̄ͧ̉ͧͨͅá̳̜̈̓͛͠͏̢̄ͧ̉ͧͨͅs̵̢̥̖̰̥̼̯ͪͭ̿͗͌ͪ͊s̵̢̥̖̰̥̼̯ͪͭ̿͗͌ͪ͊s̘̱͕̓̅͛̆̅ͮ́̅ͧͣ̈̚s̘̱͕̓̅͛̆̅ͮ́̅ͧͣ̈̚ ̡̮̹̹̗͎̝ͣ̇́ͤ̾ͤ͞ͅ ̡̮̹̹̗͎̝ͣ̇́ͤ̾ͤ͞ͅt̡̛̝̯̱̖̠̱ͤ͒͆̍̚͘ͅt̡̛̝̯̱̖̠̱ͤ͒͆̍̚͘ͅh̛̯̻̩̘̤̳̿̓͂̐͐͡͡͠h̛̯̻̩̘̤̳̿̓͂̐͐͡͡͠ë́͏̩̣̗̺̟ͭ̃̾͂̀͘͢͝ë́͏̩̣̗̺̟ͭ̃̾͂̀͘͢͝m̸̜͔̮̥̹̲̖̲̄̈̊̎ͬ͠m̸̜͔̮̥̹̲̖̲̄̈̊̎ͬ͠ ̝͇̏͏̡̟̥͍ͦ̋̎ͤ̕͢͜ ̝͇̏͏̡̟̥͍ͦ̋̎ͤ̕͢͜ó͖̬̩̤̜̫͔͑̌ͫ̈́͡͏̇ó͖̬̩̤̜̫͔͑̌ͫ̈́͡͏̇f̴̶̴̥͔̗͖̬̆͒ͨ͊ͬͅͅf̴̶̴̥͔̗͖̬̆͒ͨ͊ͬͅͅ ̮̦̲̼̞̑ͨ͒̌ͤ̿́̌͐͒ ̮̦̲̼̞̑ͨ͒̌ͤ̿́̌͐͒t̛̮̰͔̋͂͗̓͋̇̅̆̒͊ͅt̛̮̰͔̋͂͗̓͋̇̅̆̒͊ͅo̴̢͚̮̳͙̟̳̐ͬ͑̃̓͡ͅo̴̢͚̮̳͙̟̳̐ͬ͑̃̓͡ͅ ̝̺͖͒ͯͭ̑ͤ͊ͮ͂̚̚͡ͅ ̝̺͖͒ͯͭ̑ͤ͊ͮ͂̚̚͡ͅt̶̨̲̦͉͖̲̤̗ͬ̋̋ͦ̂ͯt̶̨̲̦͉͖̲̤̗ͬ̋̋ͦ̂ͯh̶̨̤͍̜̯͈͇͛ͩ́̀͊ͮͩh̶̨̤͍̜̯͈͇͛ͩ́̀͊ͮͩe̡̢̤̰̰͙̭͈̓ͯͬ͑ͨ̃͢e̡̢̤̰̰͙̭͈̓ͯͬ͑ͨ̃͢ ̶̛̺̦̯̹̞͎̟̥̞̝̐̕ͅ ̶̛̺̦̯̹̞͎̟̥̞̝̐̕ͅU͙̓ͤ͏̟̗̟͕̥̰́͑̆ͧ͟U͙̓ͤ͏̟̗̟͕̥̰́͑̆ͧ͟I̪̩͕͕̼̎͐ͭͦ͐̋̐̅ͯ͢I̪̩͕͕̼̎͐ͭͦ͐̋̐̅ͯ͢ ̢̦͍̰̬͚ͯ́ͫ̿ͨ͘͘͝͡ ̢̦͍̰̬͚ͯ́ͫ̿ͨ͘͘͝͡t̴̨͉̟̥͛͐̇̀̎̒̄ͧ̀̇t̴̨͉̟̥͛͐̇̀̎̒̄ͧ̀̇o̸͇͏̷͍͉̠ͤ̈̾ͤ͛ͥ̚͝o̸͇͏̷͍͉̠ͤ̈̾ͤ͛ͥ̚͝ ̸̣͕̝̯̼́ͨͯ̏̋̂̑́͘ ̸̣͕̝̯̼́ͨͯ̏̋̂̑́͘l̵̨̛̬̱̣̬͚̺̫̳ͨ̽ͫͯl̵̨̛̬̱̣̬͚̺̫̳ͨ̽ͫͯḙ̳͕̝̥̄̆ͮ̄ͦͨ̓̚͏͢ḙ̳͕̝̥̄̆ͮ̄ͦͨ̓̚͏͢t̵̼̲̣̉̀̌ͭ̒̓͌̀͒̀ͅt̵̼̲̣̉̀̌ͭ̒̓͌̀͒̀ͅ ̺͈͙̘̣̩̙͕̋̇͆̀͊̇̂ ̺͈͙̘̣̩̙͕̋̇͆̀͊̇̂i̧̭̲̼̗̥̪̣̭ͬ͑ͨ̓̈̐i̧̭̲̼̗̥̪̣̭ͬ͑ͨ̓̈̐ṱ̴̯̲̱̫̲̥ͭ̀͋̂̚̕͟ṱ̴̯̲̱̫̲̥ͭ̀͋̂̚̕͟ ̖̗͔̦̲̻̌̀̏͆͊ͤ̑ͨ̉ ̖̗͔̦̲̻̌̀̏͆͊ͤ̑ͨ̉s̨̢͔̄̃ͯ̈́̑͐̚̕͢͝͝s̨̢͔̄̃ͯ̈́̑͐̚̕͢͝͝t͚͉͇̳̘̅̇̋͌̀̋́ͨ́͏t͚͉͇̳̘̅̇̋͌̀̋́ͨ́͏â͇͎̺ͨͭ͡͏͚̯ͤͩ͋ͧ͘â͇͎̺ͨͭ͡͏͚̯ͤͩ͋ͧ͘r̷̘̜͍̫̯ͭͪ͑͗̓͆͟͝ͅr̷̘̜͍̫̯ͭͪ͑͗̓͆͟͝ͅṭ̷̢̱͕̎ͬ̿́́͊̐͟͢͜ṭ̷̢̱͕̎ͬ̿́́͊̐͟͢͜ ̟̥̖͕̭͍̲ͩ̆̒̑͊̕̚͡ ̟̥̖͕̭͍̲ͩ̆̒̑͊̕̚͡p̶̴̨̧̜̰̜̘̉̽ͤ́͘͢͜p̶̴̨̧̜̰̜̘̉̽ͤ́͘͢͜ṙ̠̘̟̭͖̜̜͍ͦ̾͒͜͠͞ṙ̠̘̟̭͖̜̜͍ͦ̾͒͜͠͞ǒ̷̶̫͈̫̹ͬ͂ͧ̿̿̑͂͂ǒ̷̶̫͈̫̹ͬ͂ͧ̿̿̑͂͂c̵̸̮͕̮͈̞̼͎͉͍̑́ͭ̀c̵̸̮͕̮͈̞̼͎͉͍̑́ͭ̀e̸̡͔͓̳̞̟̘ͩ̍̽ͪͤͣ͢e̸̡͔͓̳̞̟̘ͩ̍̽ͪͤͣ͢s̨͍̬̖͂̏ͦ̀ͫ̐ͨͪ͡ͅͅs̨͍̬̖͂̏ͦ̀ͫ̐ͨͪ͡ͅͅs̡̻̹̜͍̺͌͛ͮ̓̀̈́̉̿͑s̡̻̹̜͍̺͌͛ͮ̓̀̈́̉̿͑í̤̜ͭ͢͏̶̶̹͍ͤͪ̉ͫ̋í̤̜ͭ͢͏̶̶̹͍ͤͪ̉ͫ̋ņ̵̼̪̭̲̤͙͖̒̑ͨ͂̌͘ņ̵̼̪̭̲̤͙͖̒̑ͨ͂̌͘g̷̢̢̭̘̙̥̖̲̭͛ͣ́̀̍g̷̢̢̭̘̙̥̖̲̭͛ͣ́̀̍ ̷̺̱̙̹͔̗͆ͪ̾ͬͬ̓͘͠ ̷̺̱̙̹͔̗͆ͪ̾ͬͬ̓͘͠t̛̤̻̲̓̓ͩ̇ͫͫ͆ͦ͛̕͞t̛̤̻̲̓̓ͩ̇ͫͫ͆ͦ͛̕͞ḣ̜̘̮̫͍̗͇ͥͯ̽̕͢͢͝ḣ̜̘̮̫͍̗͇ͥͯ̽̕͢͢͝ẹ̵̱̹͚͖̜̞̆̾͌ͬ̀̿͞ẹ̵̱̹͚͖̜̞̆̾͌ͬ̀̿͞m̶̢̧͉̝̜̝̍͑͂̽̌̉̈́ͩm̶̢̧͉̝̜̝̍͑͂̽̌̉̈́ͩ }|
+ {100:~ }|*6
+ |
+ ]],
+ })
+ end)
+
it('works with arabic input and arabicshape', function()
command('set arabic')
@@ -285,11 +304,6 @@ describe('multibyte rendering: statusline', function()
before_each(function()
clear()
screen = Screen.new(40, 4)
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { bold = true, reverse = true },
- [3] = { background = Screen.colors.Red, foreground = Screen.colors.Gray100 },
- })
screen:attach()
command('set laststatus=2')
end)
@@ -299,7 +313,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
- {2:你好 }|
+ {3:你好 }|
|
]])
end)
@@ -308,7 +322,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
- {2:abc }|
+ {3:abc }|
|
]])
end)
@@ -317,7 +331,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
- {2:<9f> }|
+ {3:<9f> }|
|
]])
end)
@@ -327,7 +341,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
- {2:o̸⃯ᷰ⃐⃧⃝ }|
+ {3:o̸⃯ᷰ⃐⃧⃝ }|
|
]])
end)
@@ -337,7 +351,7 @@ describe('multibyte rendering: statusline', function()
screen:expect([[
^ |
{1:~ }|
- {2:<9f><1df0><20ef><0338><20d0><20e7><20dd>}|
+ {3:<9f><1df0><20ef><0338><20d0><20e7><20dd>}|
|
]])
end)
@@ -348,7 +362,7 @@ describe('multibyte rendering: statusline', function()
grid = [[
^ |
{1:~ }|
- {2: Q≡ }|
+ {3: Q≡ }|
|
]],
}
@@ -361,7 +375,7 @@ describe('multibyte rendering: statusline', function()
grid = [[
^ |
{1:~ }|
- {2:🧑�💻 }|
+ {3:🧑�💻 }|
|
]],
}
@@ -375,7 +389,7 @@ describe('multibyte rendering: statusline', function()
grid = [[
^ |
{1:~ }|
- {2:xx}{3:🧑<200d>💻}{2:yy }|
+ {3:xx}{9:🧑<200d>💻}{3:yy }|
|
]],
}
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index c1d3af085f..dc48061a6c 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -1,12 +1,14 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local feed, command, insert = helpers.feed, helpers.command, helpers.insert
-local eq = helpers.eq
-local fn = helpers.fn
-local api = helpers.api
-local curwin = helpers.api.nvim_get_current_win
-local poke_eventloop = helpers.poke_eventloop
+
+local clear = n.clear
+local feed, command, insert = n.feed, n.command, n.insert
+local eq = t.eq
+local fn = n.fn
+local api = n.api
+local curwin = n.api.nvim_get_current_win
+local poke_eventloop = n.poke_eventloop
describe('ext_multigrid', function()
@@ -412,9 +414,23 @@ describe('ext_multigrid', function()
end)
describe('grid of smaller inner size', function()
+ before_each(function()
+ screen:try_resize_grid(2, 20, 5)
+ end)
+
it('is rendered correctly', function()
+ screen:expect{grid=[[
+ ## grid 1
+ [2:-----------------------------------------------------]|*12
+ {11:[No Name] }|
+ [3:-----------------------------------------------------]|
+ ## grid 2
+ ^ |
+ {1:~ }|*4
+ ## grid 3
+ |
+ ]]}
screen:try_resize_grid(2, 8, 5)
-
screen:expect{grid=[[
## grid 1
[2:-----------------------------------------------------]|*12
@@ -427,12 +443,43 @@ describe('ext_multigrid', function()
|
]]}
end)
+
+ it("cursor draws correctly with double-width char and 'showbreak'", function()
+ insert(('a'):rep(19) .. '哦bbbb')
+ command('setlocal showbreak=++')
+ screen:expect{grid=[[
+ ## grid 1
+ [2:-----------------------------------------------------]|*12
+ {11:[No Name] [+] }|
+ [3:-----------------------------------------------------]|
+ ## grid 2
+ aaaaaaaaaaaaaaaaaaa{1:>}|
+ {1:++}哦bbb^b |
+ {1:~ }|*3
+ ## grid 3
+ |
+ ]]}
+ end)
end)
describe('grid of bigger inner size', function()
+ before_each(function()
+ screen:try_resize_grid(2, 60, 20)
+ end)
+
it('is rendered correctly', function()
+ screen:expect{grid=[[
+ ## grid 1
+ [2:-----------------------------------------------------]|*12
+ {11:[No Name] }|
+ [3:-----------------------------------------------------]|
+ ## grid 2
+ ^ |
+ {1:~ }|*19
+ ## grid 3
+ |
+ ]]}
screen:try_resize_grid(2, 80, 20)
-
screen:expect{grid=[[
## grid 1
[2:-----------------------------------------------------]|*12
@@ -445,13 +492,6 @@ describe('ext_multigrid', function()
|
]]}
end)
- end)
-
-
- describe('with resized grid', function()
- before_each(function()
- screen:try_resize_grid(2, 60, 20)
- end)
it('winwidth() winheight() getwininfo() return inner width and height #19743', function()
eq(60, fn.winwidth(0))
@@ -483,7 +523,7 @@ describe('ext_multigrid', function()
]]}
end)
- it('"g$" works correctly with double-width characters and no wrapping', function()
+ it('g$ works correctly with double-width chars and no wrapping', function()
command('set nowrap')
insert(('a'):rep(58) .. ('哦'):rep(3))
feed('0')
@@ -543,6 +583,22 @@ describe('ext_multigrid', function()
## grid 3
|
]]}
+ command('setlocal breakindent breakindentopt=shift:8')
+ feed('g$')
+ screen:expect{grid=[[
+ ## grid 1
+ [2:-----------------------------------------------------]|*12
+ {11:[No Name] [+] }|
+ [3:-----------------------------------------------------]|
+ ## grid 2
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
+ {23:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb^b}|
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
+ |
+ {1:~ }|*16
+ ## grid 3
+ |
+ ]]}
end)
it('displays messages with default grid width', function()
@@ -685,6 +741,75 @@ describe('ext_multigrid', function()
[4] = {-1, "SW", 1, 13, 5, false, 250};
}}
end)
+
+ it('half-page scrolling stops at end of buffer', function()
+ command('set number')
+ insert(('foobar\n'):rep(100))
+ feed('7<C-Y>')
+ screen:expect({
+ grid = [[
+ ## grid 1
+ [2:-----------------------------------------------------]|*12
+ {11:[No Name] [+] }|
+ [3:-----------------------------------------------------]|
+ ## grid 2
+ {19: 75 }foobar |
+ {19: 76 }foobar |
+ {19: 77 }foobar |
+ {19: 78 }foobar |
+ {19: 79 }foobar |
+ {19: 80 }foobar |
+ {19: 81 }foobar |
+ {19: 82 }foobar |
+ {19: 83 }foobar |
+ {19: 84 }foobar |
+ {19: 85 }foobar |
+ {19: 86 }foobar |
+ {19: 87 }foobar |
+ {19: 88 }foobar |
+ {19: 89 }foobar |
+ {19: 90 }foobar |
+ {19: 91 }foobar |
+ {19: 92 }foobar |
+ {19: 93 }foobar |
+ {19: 94 }^foobar |
+ ## grid 3
+ |
+ ]],
+ })
+ feed('<C-D>')
+ screen:expect({
+ grid = [[
+ ## grid 1
+ [2:-----------------------------------------------------]|*12
+ {11:[No Name] [+] }|
+ [3:-----------------------------------------------------]|
+ ## grid 2
+ {19: 82 }foobar |
+ {19: 83 }foobar |
+ {19: 84 }foobar |
+ {19: 85 }foobar |
+ {19: 86 }foobar |
+ {19: 87 }foobar |
+ {19: 88 }foobar |
+ {19: 89 }foobar |
+ {19: 90 }foobar |
+ {19: 91 }foobar |
+ {19: 92 }foobar |
+ {19: 93 }foobar |
+ {19: 94 }foobar |
+ {19: 95 }foobar |
+ {19: 96 }foobar |
+ {19: 97 }foobar |
+ {19: 98 }foobar |
+ {19: 99 }foobar |
+ {19:100 }foobar |
+ {19:101 }^ |
+ ## grid 3
+ |
+ ]],
+ })
+ end)
end)
it('multiline messages scroll over windows', function()
@@ -2300,6 +2425,9 @@ describe('ext_multigrid', function()
]], win_viewport={
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ }, win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 0, bottom = 0, left = 0, right = 0};
}}
-- XXX: hack to get notifications. Could use next_msg() also.
@@ -2330,6 +2458,9 @@ describe('ext_multigrid', function()
]], win_viewport={
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ }, win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 1, bottom = 0, left = 0, right = 0};
}}
eq({}, win_pos)
@@ -2352,6 +2483,9 @@ describe('ext_multigrid', function()
]], win_viewport={
[2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
[4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ }, win_viewport_margins={
+ [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0};
+ [4] = {win = 1001, top = 0, bottom = 0, left = 0, right = 0};
}}
eq({}, win_pos)
end)
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 98af82a7c5..b40ff29dec 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -1,10 +1,12 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local eq = helpers.eq
-local shallowcopy = helpers.shallowcopy
-local eval = helpers.eval
+
+local clear = n.clear
+local command = n.command
+local eq = t.eq
+local shallowcopy = t.shallowcopy
+local eval = n.eval
describe('UI receives option updates', function()
local screen
diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua
index 5e340af89c..4f6454a0fb 100644
--- a/test/functional/ui/output_spec.lua
+++ b/test/functional/ui/output_spec.lua
@@ -1,19 +1,21 @@
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local helpers = require('test.functional.helpers')(after_each)
-local child_session = require('test.functional.terminal.helpers')
-local assert_alive = helpers.assert_alive
-local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir
-local eq = helpers.eq
-local feed = helpers.feed
-local feed_command = helpers.feed_command
-local clear = helpers.clear
-local command = helpers.command
-local testprg = helpers.testprg
-local nvim_dir = helpers.nvim_dir
-local has_powershell = helpers.has_powershell
-local set_shell_powershell = helpers.set_shell_powershell
-local skip = helpers.skip
-local is_os = helpers.is_os
+local tt = require('test.functional.terminal.testutil')
+
+local assert_alive = n.assert_alive
+local mkdir, write_file, rmdir = t.mkdir, t.write_file, n.rmdir
+local eq = t.eq
+local feed = n.feed
+local feed_command = n.feed_command
+local clear = n.clear
+local command = n.command
+local testprg = n.testprg
+local nvim_dir = n.nvim_dir
+local has_powershell = n.has_powershell
+local set_shell_powershell = n.set_shell_powershell
+local skip = t.skip
+local is_os = t.is_os
clear() -- for has_powershell()
@@ -21,7 +23,7 @@ describe('shell command :!', function()
local screen
before_each(function()
clear()
- screen = child_session.setup_child_nvim({
+ screen = tt.setup_child_nvim({
'-u',
'NONE',
'-i',
@@ -29,7 +31,7 @@ describe('shell command :!', function()
'--cmd',
'colorscheme vim',
'--cmd',
- helpers.nvim_set .. ' notermguicolors',
+ n.nvim_set .. ' notermguicolors',
})
screen:expect([[
{1: } |
@@ -40,14 +42,14 @@ describe('shell command :!', function()
end)
after_each(function()
- child_session.feed_data('\3') -- Ctrl-C
+ tt.feed_data('\3') -- Ctrl-C
end)
it('displays output without LF/EOF. #4646 #4569 #3772', function()
skip(is_os('win'))
-- NOTE: We use a child nvim (within a :term buffer)
-- to avoid triggering a UI flush.
- child_session.feed_data(':!printf foo; sleep 200\n')
+ tt.feed_data(':!printf foo; sleep 200\n')
screen:expect([[
|
{4:~ }|*2
@@ -61,7 +63,7 @@ describe('shell command :!', function()
it('throttles shell-command output greater than ~10KB', function()
skip(is_os('openbsd'), 'FIXME #10804')
skip(is_os('win'))
- child_session.feed_data((':!%s REP 30001 foo\n'):format(testprg('shell-test')))
+ tt.feed_data((':!%s REP 30001 foo\n'):format(testprg('shell-test')))
-- If we observe any line starting with a dot, then throttling occurred.
-- Avoid false failure on slow systems.
@@ -80,7 +82,7 @@ describe('shell command :!', function()
{3:-- TERMINAL --} |
]],
{
- -- test/functional/helpers.lua defaults to background=light.
+ -- test/functional/testnvim.lua defaults to background=light.
[1] = { reverse = true },
[3] = { bold = true },
[10] = { foreground = 2 },
@@ -107,20 +109,15 @@ describe('shell command :!', function()
it('handles control codes', function()
skip(is_os('win'), 'missing printf')
local screen = Screen.new(50, 4)
- screen:set_default_attr_ids {
- [1] = { bold = true, reverse = true },
- [2] = { bold = true, foreground = Screen.colors.SeaGreen },
- [3] = { foreground = Screen.colors.Blue },
- }
screen:attach()
-- Print TAB chars. #2958
feed([[:!printf '1\t2\t3'<CR>]])
screen:expect {
grid = [[
- {1: }|
+ {3: }|
:!printf '1\t2\t3' |
1 2 3 |
- {2:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]],
}
feed([[<CR>]])
@@ -130,10 +127,10 @@ describe('shell command :!', function()
feed([[:!printf '\007\007\007\007text'<CR>]])
screen:expect {
grid = [[
- {1: }|
+ {3: }|
:!printf '\007\007\007\007text' |
text |
- {2:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]],
condition = function()
eq(true, screen.bell)
@@ -144,10 +141,10 @@ describe('shell command :!', function()
-- Print BS control code.
feed([[:echo system('printf ''\010\n''')<CR>]])
screen:expect([[
- {1: }|
- {3:^H} |
+ {3: }|
+ {18:^H} |
|
- {2:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed([[<CR>]])
@@ -156,7 +153,7 @@ describe('shell command :!', function()
screen:expect([[
:!printf '\n' |
|*2
- {2:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed([[<CR>]])
end)
@@ -170,12 +167,6 @@ describe('shell command :!', function()
write_file('bang_filter_spec/f2', 'f2')
write_file('bang_filter_spec/f3', 'f3')
screen = Screen.new(53, 10)
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue1 },
- [2] = { foreground = Screen.colors.Blue1 },
- [3] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [4] = { bold = true, reverse = true },
- })
screen:attach()
end)
@@ -195,13 +186,13 @@ describe('shell command :!', function()
screen:expect([[
|
{1:~ }|*2
- {4: }|
+ {3: }|
]] .. result .. [[ |
f1 |
f2 |
f3 |
|
- {3:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
end)
@@ -212,14 +203,14 @@ describe('shell command :!', function()
grid = [[
|
{1:~ }|
- {4: }|
+ {3: }|
:!cat test/functional/fixtures/shell_data.txt |
- {2:^@^A^B^C^D^E^F^H} |
- {2:^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_} |
- ö 한글 {2:<a5><c3>} |
- t {2:<ff>} |
+ {18:^@^A^B^C^D^E^F^H} |
+ {18:^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_} |
+ ö 한글 {18:<a5><c3>} |
+ t {18:<ff>} |
|
- {3:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]],
condition = function()
eq(true, screen.bell)
@@ -234,7 +225,7 @@ describe('shell command :!', function()
-- Note: only the first example of split composed char works
screen:expect([[
|
- {4: }|
+ {3: }|
:]] .. cmd .. [[ |
å |
ref: å̲ |
@@ -242,7 +233,7 @@ describe('shell command :!', function()
2: å ̲ |
3: å ̲ |
|
- {3:Press ENTER or type command to continue}^ |
+ {6:Press ENTER or type command to continue}^ |
]])
end)
end)
@@ -256,28 +247,28 @@ describe('shell command :!', function()
:!'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']])
screen:expect([[
:!$a = 1; Write-Output '$a' |
$a |
|
- Press ENTER or type command to continue^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed_command([[!"Write-Output $a"]])
screen:expect([[
:!"Write-Output $a" |
Write-Output |
|
- Press ENTER or type command to continue^ |
+ {6:Press ENTER or type command to continue}^ |
]])
feed_command([[!$a = 1; Write-Output "$a"]])
screen:expect([[
:!$a = 1; Write-Output "$a" |
1 |
|
- Press ENTER or type command to continue^ |
+ {6:Press ENTER or type command to continue}^ |
]])
if is_os('win') then
feed_command([[!& 'cmd.exe' /c 'echo $a']])
@@ -285,7 +276,7 @@ describe('shell command :!', function()
:!& 'cmd.exe' /c 'echo $a' |
$a |
|
- Press ENTER or type command to continue^ |
+ {6:Press ENTER or type command to continue}^ |
]])
else
feed_command([[!& '/bin/sh' -c 'echo ''$a''']])
@@ -293,7 +284,7 @@ describe('shell command :!', function()
:!& '/bin/sh' -c 'echo ''$a''' |
$a |
|
- Press ENTER or type command to continue^ |
+ {6:Press ENTER or type command to continue}^ |
]])
end
end)
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index 1f0d20f66d..8f8604eecb 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -1,17 +1,19 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local assert_alive = helpers.assert_alive
-local clear, feed = helpers.clear, helpers.feed
-local source = helpers.source
-local insert = helpers.insert
-local api = helpers.api
-local async_meths = helpers.async_meths
-local command = helpers.command
-local fn = helpers.fn
-local eq = helpers.eq
-local pcall_err = helpers.pcall_err
-local exec_lua = helpers.exec_lua
-local exec = helpers.exec
+
+local assert_alive = n.assert_alive
+local clear, feed = n.clear, n.feed
+local source = n.source
+local insert = n.insert
+local api = n.api
+local async_meths = n.async_meths
+local command = n.command
+local fn = n.fn
+local eq = t.eq
+local pcall_err = t.pcall_err
+local exec_lua = n.exec_lua
+local exec = n.exec
describe('ui/ext_popupmenu', function()
local screen
@@ -1171,6 +1173,10 @@ describe('builtin popupmenu', function()
[6] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[7] = { background = Screen.colors.Yellow }, -- Search
[8] = { foreground = Screen.colors.Red },
+ kn = { foreground = Screen.colors.Red, background = Screen.colors.Magenta },
+ ks = { foreground = Screen.colors.Red, background = Screen.colors.Grey },
+ xn = { foreground = Screen.colors.White, background = Screen.colors.Magenta },
+ xs = { foreground = Screen.colors.Black, background = Screen.colors.Grey },
})
screen:attach({ ext_multigrid = multigrid })
end)
@@ -1588,13 +1594,13 @@ describe('builtin popupmenu', function()
describe('floating window preview #popup', function()
it('pum popup preview', function()
--row must > 10
- screen:try_resize(30, 11)
+ screen:try_resize(40, 11)
exec([[
funct Omni_test(findstart, base)
if a:findstart
return col(".") - 1
endif
- return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "three"}]
+ return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "looooooooooooooong"}]
endfunc
set omnifunc=Omni_test
set completeopt=menu,popup
@@ -1602,94 +1608,185 @@ describe('builtin popupmenu', function()
funct Set_info()
let comp_info = complete_info()
if comp_info['selected'] == 2
- call nvim_complete_set(comp_info['selected'], {"info": "3info"})
+ call nvim__complete_set(comp_info['selected'], {"info": "3info"})
endif
endfunc
autocmd CompleteChanged * call Set_info()
]])
feed('Gi<C-x><C-o>')
-
--floating preview in right
if multigrid then
screen:expect {
grid = [[
## grid 1
- [2:------------------------------]|*10
- [3:------------------------------]|
+ [2:----------------------------------------]|*10
+ [3:----------------------------------------]|
## grid 2
- one^ |
- {1:~ }|*9
+ one^ |
+ {1:~ }|*9
## grid 3
- {2:-- }{5:match 1 of 3} |
+ {2:-- }{5:match 1 of 3} |
## grid 4
{n:1info}|
{n: }|
## grid 5
- {s:one }|
- {n:two }|
- {n:three }|
+ {s:one }|
+ {n:two }|
+ {n:looooooooooooooong }|
]],
float_pos = {
[5] = { -1, 'NW', 2, 1, 0, false, 100 },
- [4] = { 1001, 'NW', 1, 1, 15, true, 50 },
+ [4] = { 1001, 'NW', 1, 1, 19, false, 50 },
+ },
+ win_viewport = {
+ [2] = {
+ win = 1000,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 3,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
+ [4] = {
+ win = 1001,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 0,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
},
}
else
screen:expect {
grid = [[
- one^ |
- {s:one }{n:1info}{1: }|
- {n:two }{1: }|
- {n:three }{1: }|
- {1:~ }|*6
- {2:-- }{5:match 1 of 3} |
+ one^ |
+ {s:one }{n:1info}{1: }|
+ {n:two }{1: }|
+ {n:looooooooooooooong }{1: }|
+ {1:~ }|*6
+ {2:-- }{5:match 1 of 3} |
]],
- unchanged = true,
}
end
- -- test nvim_complete_set_info
- feed('<C-N><C-N>')
- vim.uv.sleep(10)
+ -- info window position should be adjusted when new leader add
+ feed('<C-P>o')
if multigrid then
screen:expect {
grid = [[
## grid 1
- [2:------------------------------]|*10
- [3:------------------------------]|
+ [2:----------------------------------------]|*10
+ [3:----------------------------------------]|
## grid 2
- three^ |
- {1:~ }|*9
+ o^ |
+ {1:~ }|*9
## grid 3
- {2:-- }{5:match 3 of 3} |
+ {2:-- }{8:Back at original} |
## grid 4
- {n:3info}|
+ {n:1info}|
{n: }|
## grid 5
{n:one }|
- {n:two }|
- {s:three }|
]],
float_pos = {
[5] = { -1, 'NW', 2, 1, 0, false, 100 },
- [4] = { 1001, 'NW', 1, 1, 15, true, 50 },
+ [4] = { 1001, 'NW', 1, 1, 15, false, 50 },
+ },
+ win_viewport = {
+ [2] = {
+ win = 1000,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 1,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
+ [4] = {
+ win = 1001,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 0,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
},
}
else
screen:expect {
grid = [[
- three^ |
- {n:one 3info}{1: }|
- {n:two }{1: }|
- {s:three }{1: }|
- {1:~ }|*6
- {2:-- }{5:match 3 of 3} |
+ o^ |
+ {n:one 1info}{1: }|
+ {1:~ }{n: }{1: }|
+ {1:~ }|*7
+ {2:-- }{8:Back at original} |
+ ]],
+ }
+ end
+
+ -- test nvim__complete_set_info
+ feed('<ESC>cc<C-X><C-O><C-N><C-N>')
+ vim.uv.sleep(10)
+ if multigrid then
+ screen:expect {
+ grid = [[
+ ## grid 1
+ [2:----------------------------------------]|*10
+ [3:----------------------------------------]|
+ ## grid 2
+ looooooooooooooong^ |
+ {1:~ }|*9
+ ## grid 3
+ {2:-- }{5:match 3 of 3} |
+ ## grid 5
+ {n:one }|
+ {n:two }|
+ {s:looooooooooooooong }|
+ ## grid 6
+ {n:3info}|
+ {n: }|
+ ]],
+ float_pos = {
+ [5] = { -1, 'NW', 2, 1, 0, false, 100 },
+ [6] = { 1002, 'NW', 1, 1, 19, false, 50 },
+ },
+ win_viewport = {
+ [2] = {
+ win = 1000,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 18,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
+ [6] = {
+ win = 1002,
+ topline = 0,
+ botline = 2,
+ curline = 0,
+ curcol = 0,
+ linecount = 1,
+ sum_scroll_delta = 0,
+ },
+ },
+ }
+ else
+ screen:expect {
+ grid = [[
+ looooooooooooooong^ |
+ {n:one 3info}{1: }|
+ {n:two }{1: }|
+ {s:looooooooooooooong }{1: }|
+ {1:~ }|*6
+ {2:-- }{5:match 3 of 3} |
]],
}
end
- -- make sure info has set
- feed('<C-y>')
- eq('3info', exec_lua('return vim.v.completed_item.info'))
-- preview in left
feed('<ESC>cc')
@@ -1699,24 +1796,24 @@ describe('builtin popupmenu', function()
screen:expect {
grid = [[
## grid 1
- [2:------------------------------]|*10
- [3:------------------------------]|
+ [2:----------------------------------------]|*10
+ [3:----------------------------------------]|
## grid 2
- itesttesttesttesttesone^t |
- {1:~ }|*9
+ itesttesttesttesttesone^t |
+ {1:~ }|*9
## grid 3
- {2:-- }{5:match 1 of 3} |
+ {2:-- }{5:match 1 of 3} |
## grid 5
- {s: one }|
- {n: two }|
- {n: three }|
- ## grid 6
+ {s: one }|
+ {n: two }|
+ {n: looooooooooooooong }|
+ ## grid 7
{n:1info}|
{n: }|
]],
float_pos = {
+ [7] = { 1003, 'NW', 1, 1, 14, false, 50 },
[5] = { -1, 'NW', 2, 1, 19, false, 100 },
- [6] = { 1002, 'NW', 1, 1, 1, true, 50 },
},
win_viewport = {
[2] = {
@@ -1728,8 +1825,8 @@ describe('builtin popupmenu', function()
linecount = 1,
sum_scroll_delta = 0,
},
- [6] = {
- win = 1002,
+ [7] = {
+ win = 1003,
topline = 0,
botline = 2,
curline = 0,
@@ -1742,12 +1839,12 @@ describe('builtin popupmenu', function()
else
screen:expect {
grid = [[
- itesttesttesttesttesone^t |
- {1:~}{n:1info}{1: }{s: one }{1: }|
- {1:~}{n: }{1: }{n: two }{1: }|
- {1:~ }{n: three }{1: }|
- {1:~ }|*6
- {2:-- }{5:match 1 of 3} |
+ itesttesttesttesttesone^t |
+ {1:~ }{n:1info}{s: one }{1: }|
+ {1:~ }{n: two }{1: }|
+ {1:~ }{n: looooooooooooooong }{1: }|
+ {1:~ }|*6
+ {2:-- }{5:match 1 of 3} |
]],
}
end
@@ -2942,7 +3039,7 @@ describe('builtin popupmenu', function()
|
{3:[No Name] }|
{1::}sign define |
- {1::}sign defin^e |
+ {1::}sign define^ |
{1:~ }|*4
{4:[Command Line] }|
:sign define |
@@ -4477,23 +4574,15 @@ describe('builtin popupmenu', function()
hi PmenuExtra guifg=White guibg=Magenta
hi PmenuExtraSel guifg=Black guibg=Grey
]])
- local attrs = screen:get_default_attr_ids()
- attrs.kn = { foreground = Screen.colors.Red, background = Screen.colors.Magenta }
- attrs.ks = { foreground = Screen.colors.Red, background = Screen.colors.Grey }
- attrs.xn = { foreground = Screen.colors.White, background = Screen.colors.Magenta }
- attrs.xs = { foreground = Screen.colors.Black, background = Screen.colors.Grey }
feed('iaw<C-X><C-u>')
- screen:expect(
- [[
+ screen:expect([[
aword1^ |
{s:aword1 }{ks:W }{xs:extra text 1 }{1: }|
{n:aword2 }{kn:W }{xn:extra text 2 }{1: }|
{n:aword3 }{kn:W }{xn:extra text 3 }{1: }|
{1:~ }|*3
{2:-- }{5:match 1 of 3} |
- ]],
- attrs
- )
+ ]])
end)
end)
end
diff --git a/test/functional/ui/quickfix_spec.lua b/test/functional/ui/quickfix_spec.lua
index 40f8ef353a..73923a153a 100644
--- a/test/functional/ui/quickfix_spec.lua
+++ b/test/functional/ui/quickfix_spec.lua
@@ -1,7 +1,8 @@
-local helpers = require('test.functional.helpers')(after_each)
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, api = helpers.clear, helpers.feed, helpers.api
-local insert, command = helpers.insert, helpers.command
+
+local clear, feed, api = n.clear, n.feed, n.api
+local insert, command = n.insert, n.command
describe('quickfix selection highlight', function()
local screen
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index e8d7d5c72d..4625ce8553 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -70,17 +70,19 @@
-- To help write screen tests, see Screen:snapshot_util().
-- To debug screen tests, see Screen:redraw_debug().
-local helpers = require('test.functional.helpers')(nil)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local busted = require('busted')
+
local deepcopy = vim.deepcopy
-local shallowcopy = helpers.shallowcopy
-local concat_tables = helpers.concat_tables
+local shallowcopy = t.shallowcopy
+local concat_tables = t.concat_tables
local pesc = vim.pesc
-local run_session = helpers.run_session
-local eq = helpers.eq
-local dedent = helpers.dedent
-local get_session = helpers.get_session
-local create_callindex = helpers.create_callindex
+local run_session = n.run_session
+local eq = t.eq
+local dedent = t.dedent
+local get_session = n.get_session
+local create_callindex = n.create_callindex
local inspect = vim.inspect
@@ -139,6 +141,43 @@ local function _init_colors()
end
Screen.colors = colors
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
--- @param width? integer
@@ -167,6 +206,7 @@ function Screen.new(width, height)
wildmenu_selected = nil,
win_position = {},
win_viewport = {},
+ win_viewport_margins = {},
float_pos = {},
msg_grid = nil,
msg_grid_pos = nil,
@@ -217,6 +257,17 @@ function Screen:set_default_attr_ids(attr_ids)
self._default_attr_ids = attr_ids
end
+function Screen:add_extra_attr_ids(extra_attr_ids)
+ local attr_ids = vim.deepcopy(Screen._global_default_attr_ids)
+ for id, attr in pairs(extra_attr_ids) do
+ if type(id) == 'number' and id < 100 then
+ error('extra attr ids should be at least 100 or be strings')
+ end
+ attr_ids[id] = attr
+ end
+ self._default_attr_ids = attr_ids
+end
+
function Screen:get_default_attr_ids()
return deepcopy(self._default_attr_ids)
end
@@ -234,7 +285,7 @@ end
--- @field rgb? boolean
--- @field _debug_float? boolean
---- @param options test.functional.ui.screen.Opts
+--- @param options? test.functional.ui.screen.Opts
--- @param session? test.Session
function Screen:attach(options, session)
session = session or get_session()
@@ -257,6 +308,10 @@ function Screen:attach(options, session)
if self._options.ext_multigrid then
self._options.ext_linegrid = true
end
+
+ if self._default_attr_ids == nil then
+ self._default_attr_ids = Screen._global_default_attr_ids
+ end
end
function Screen:detach()
@@ -296,6 +351,7 @@ local ext_keys = {
'ruler',
'float_pos',
'win_viewport',
+ 'win_viewport_margins',
}
local expect_keys = {
@@ -480,7 +536,10 @@ function Screen:expect(expected, attr_ids, ...)
attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids or {})
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
-- Search for `any` anywhere in the screen lines.
@@ -577,6 +636,9 @@ screen:redraw_debug() to show all intermediate screen states.]]
if expected.win_viewport == nil then
extstate.win_viewport = nil
end
+ if expected.win_viewport_margins == nil then
+ extstate.win_viewport_margins = nil
+ end
if expected.float_pos then
expected.float_pos = deepcopy(expected.float_pos)
@@ -949,6 +1011,7 @@ function Screen:_handle_grid_destroy(grid)
if self._options.ext_multigrid then
self.win_position[grid] = nil
self.win_viewport[grid] = nil
+ self.win_viewport_margins[grid] = nil
end
end
@@ -1004,6 +1067,16 @@ function Screen:_handle_win_viewport(
}
end
+function Screen:_handle_win_viewport_margins(grid, win, top, bottom, left, right)
+ self.win_viewport_margins[grid] = {
+ win = win,
+ top = top,
+ bottom = bottom,
+ left = left,
+ right = right,
+ }
+end
+
function Screen:_handle_win_float_pos(grid, ...)
self.win_position[grid] = nil
self.float_pos[grid] = { ... }
@@ -1422,6 +1495,8 @@ function Screen:_extstate_repr(attr_state)
end
local win_viewport = (next(self.win_viewport) and self.win_viewport) or nil
+ local win_viewport_margins = (next(self.win_viewport_margins) and self.win_viewport_margins)
+ or nil
return {
popupmenu = self.popupmenu,
@@ -1436,6 +1511,7 @@ function Screen:_extstate_repr(attr_state)
msg_history = msg_history,
float_pos = self.float_pos,
win_viewport = win_viewport,
+ win_viewport_margins = win_viewport_margins,
}
end
@@ -1642,23 +1718,26 @@ function Screen:_print_snapshot(attrs, ignore)
if self._options.ext_linegrid then
dict = self:_pprint_hlitem(a)
else
- dict = '{' .. self:_pprint_attrs(a) .. '}'
+ dict = '{ ' .. self:_pprint_attrs(a) .. ' }'
end
local keyval = (type(i) == 'number') and '[' .. tostring(i) .. ']' or i
- table.insert(attrstrs, ' ' .. keyval .. ' = ' .. dict .. ';')
+ table.insert(attrstrs, ' ' .. keyval .. ' = ' .. dict .. ',')
end
- attrstr = (', attr_ids={\n' .. table.concat(attrstrs, '\n') .. '\n}')
+ attrstr = (',\n attr_ids = {\n ' .. table.concat(attrstrs, '\n ') .. '\n },')
elseif isempty(attrs) then
- attrstr = ', attr_ids={}'
+ attrstr = ',\n attr_ids = {},'
end
- local result = 'screen:expect{grid=[[\n' .. kwargs.grid .. '\n]]' .. attrstr
+ local result = ('screen:expect({\n grid = [[\n %s\n ]]%s'):format(
+ kwargs.grid:gsub('\n', '\n '),
+ attrstr
+ )
for _, k in ipairs(ext_keys) do
if ext_state[k] ~= nil and not (k == 'win_viewport' and not self.options.ext_multigrid) then
result = result .. ', ' .. k .. '=' .. fmt_ext_state(k, ext_state[k])
end
end
- result = result .. '}'
+ result = result .. '\n})'
return result
end
@@ -1764,20 +1843,20 @@ function Screen:_pprint_hlitem(item)
-- print(inspect(item))
local multi = self._rgb_cterm or self._options.ext_hlstate
local cterm = (not self._rgb_cterm and not self._options.rgb)
- local attrdict = '{' .. self:_pprint_attrs(multi and item[1] or item, cterm) .. '}'
+ local attrdict = '{ ' .. self:_pprint_attrs(multi and item[1] or item, cterm) .. ' }'
local attrdict2, hlinfo
local descdict = ''
if self._rgb_cterm then
- attrdict2 = ', {' .. self:_pprint_attrs(item[2], true) .. '}'
+ attrdict2 = ', { ' .. self:_pprint_attrs(item[2], true) .. ' }'
hlinfo = item[3]
else
attrdict2 = ''
hlinfo = item[2]
end
if self._options.ext_hlstate then
- descdict = ', {' .. self:_pprint_hlinfo(hlinfo) .. '}'
+ descdict = ', { ' .. self:_pprint_hlinfo(hlinfo) .. ' }'
end
- return (multi and '{' or '') .. attrdict .. attrdict2 .. descdict .. (multi and '}' or '')
+ return (multi and '{ ' or '') .. attrdict .. attrdict2 .. descdict .. (multi and ' }' or '')
end
function Screen:_pprint_hlinfo(states)
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 42e2b4d4b5..54580bf47c 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -1,15 +1,17 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local spawn, set_session, clear = helpers.spawn, helpers.set_session, helpers.clear
-local feed, command = helpers.feed, helpers.command
-local insert = helpers.insert
-local eq = helpers.eq
-local fn, api = helpers.fn, helpers.api
+
+local spawn, set_session, clear = n.spawn, n.set_session, n.clear
+local feed, command = n.feed, n.command
+local insert = n.insert
+local eq = t.eq
+local fn, api = n.fn, n.api
describe('screen', function()
local screen
local nvim_argv = {
- helpers.nvim_prog,
+ n.nvim_prog,
'-u',
'NONE',
'-i',
@@ -27,17 +29,13 @@ describe('screen', function()
set_session(screen_nvim)
screen = Screen.new()
screen:attach()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = 255 },
- [1] = { bold = true, reverse = true },
- })
end)
it('default initial screen', function()
screen:expect([[
^ |
- {0:~ }|*11
- {1:[No Name] }|
+ {1:~ }|*11
+ {3:[No Name] }|
|
]])
end)
@@ -704,7 +702,7 @@ describe('Screen default colors', function()
local extra = (light and ' background=light') or ''
local nvim_argv = {
- helpers.nvim_prog,
+ n.nvim_prog,
'-u',
'NONE',
'-i',
@@ -811,9 +809,6 @@ end)
it("showcmd doesn't cause empty grid_line with redrawdebug=compositor #22593", function()
clear()
local screen = Screen.new(30, 2)
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- })
screen:attach()
command('set showcmd redrawdebug=compositor')
feed('d')
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index a05436cf55..8bdf528412 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -1,12 +1,14 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command = helpers.command
-local feed_command = helpers.feed_command
-local eq = helpers.eq
-local eval = helpers.eval
-local fn = helpers.fn
-local testprg = helpers.testprg
+
+local clear, feed, insert = n.clear, n.feed, n.insert
+local command = n.command
+local feed_command = n.feed_command
+local eq = t.eq
+local eval = n.eval
+local fn = n.fn
+local testprg = n.testprg
describe('search highlighting', function()
local screen
@@ -53,7 +55,7 @@ describe('search highlighting', function()
topline = 0,
botline = 3,
curline = 0,
- curcol = 8,
+ curcol = 9,
linecount = 2,
sum_scroll_delta = 0,
},
@@ -674,4 +676,18 @@ describe('search highlighting', function()
:%g@a/b^ |
]])
end)
+
+ it('incsearch is still visible after :redraw from K_EVENT', function()
+ fn.setline(1, { 'foo', 'bar' })
+ feed('/foo<CR>/bar')
+ screen:expect([[
+ foo |
+ {3:bar} |
+ {1:~ }|*4
+ /bar^ |
+ ]])
+ command('redraw!')
+ -- There is an intermediate state where :redraw! removes 'incsearch' highlight.
+ screen:expect_unchanged(true)
+ end)
end)
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index 847a918dc9..b353b3738a 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -1,7 +1,9 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local api, clear, eq = helpers.api, helpers.clear, helpers.eq
-local eval, exec, feed = helpers.eval, helpers.exec, helpers.feed
+
+local api, clear, eq = n.api, n.clear, t.eq
+local eval, exec, feed = n.eval, n.exec, n.feed
describe('Signs', function()
local screen
@@ -205,7 +207,7 @@ describe('Signs', function()
screen:expect([[
{2: }{6: 1 }a |
{2: }{6: 2 }b |
- {1:>>}WW{6: 3 }c |
+ WW{1:>>}{6: 3 }c |
{2: }{6: 4 }^ |
{0:~ }|*9
|
@@ -218,9 +220,9 @@ describe('Signs', function()
sign place 3 line=2 name=pietError buffer=1
]])
screen:expect([[
- {1:>>}{8:XX}{6: 1 }a |
- {8:XX}{1:>>}{6: 2 }b |
- {1:>>}WW{6: 3 }c |
+ {8:XX}{1:>>}{6: 1 }a |
+ {1:>>}{8:XX}{6: 2 }b |
+ WW{1:>>}{6: 3 }c |
{2: }{6: 4 }^ |
{0:~ }|*9
|
@@ -238,9 +240,9 @@ describe('Signs', function()
-- "auto:3" accommodates all the signs we defined so far.
exec('set signcolumn=auto:3')
local s3 = [[
- {1:>>}{8:XX}{2: }{6: 1 }a |
- {8:XX}{1:>>}{2: }{6: 2 }b |
- {8:XX}{1:>>}WW{6: 3 }c |
+ {8:XX}{1:>>}{2: }{6: 1 }a |
+ {1:>>}{8:XX}{2: }{6: 2 }b |
+ WW{1:>>}{8:XX}{6: 3 }c |
{2: }{6: 4 }^ |
{0:~ }|*9
|
@@ -249,9 +251,9 @@ describe('Signs', function()
-- Check "yes:9".
exec('set signcolumn=yes:9')
screen:expect([[
- {1:>>}{8:XX}{2: }{6: 1 }a |
- {8:XX}{1:>>}{2: }{6: 2 }b |
- {8:XX}{1:>>}WW{2: }{6: 3 }c |
+ {8:XX}{1:>>}{2: }{6: 1 }a |
+ {1:>>}{8:XX}{2: }{6: 2 }b |
+ WW{1:>>}{8:XX}{2: }{6: 3 }c |
{2: }{6: 4 }^ |
{0:~ }|*9
|
@@ -264,8 +266,8 @@ describe('Signs', function()
exec('3move1')
exec('2d')
screen:expect([[
- {1:>>}{8:XX}{6: 1 }a |
- {8:XX}{1:>>}{6: 2 }^b |
+ {8:XX}{1:>>}{6: 1 }a |
+ {1:>>}{8:XX}{6: 2 }^b |
{2: }{6: 3 } |
{0:~ }|*10
|
@@ -273,8 +275,8 @@ describe('Signs', function()
-- character deletion does not delete signs.
feed('x')
screen:expect([[
- {1:>>}{8:XX}{6: 1 }a |
- {8:XX}{1:>>}{6: 2 }^ |
+ {8:XX}{1:>>}{6: 1 }a |
+ {1:>>}{8:XX}{6: 2 }^ |
{2: }{6: 3 } |
{0:~ }|*10
|
diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua
index 8b5644ee42..da112148cd 100644
--- a/test/functional/ui/spell_spec.lua
+++ b/test/functional/ui/spell_spec.lua
@@ -1,13 +1,15 @@
-- Test for scenarios involving 'spell'
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local exec = helpers.exec
-local feed = helpers.feed
-local insert = helpers.insert
-local api = helpers.api
-local is_os = helpers.is_os
+
+local clear = n.clear
+local exec = n.exec
+local feed = n.feed
+local insert = n.insert
+local api = n.api
+local is_os = t.is_os
describe("'spell'", function()
local screen
diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua
index 41406a5860..faf94bccbe 100644
--- a/test/functional/ui/statuscolumn_spec.lua
+++ b/test/functional/ui/statuscolumn_spec.lua
@@ -1,15 +1,17 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local eq = helpers.eq
-local exec = helpers.exec
-local eval = helpers.eval
-local exec_lua = helpers.exec_lua
-local feed = helpers.feed
-local api = helpers.api
-local pcall_err = helpers.pcall_err
-local assert_alive = helpers.assert_alive
+
+local clear = n.clear
+local command = n.command
+local eq = t.eq
+local exec = n.exec
+local eval = n.eval
+local exec_lua = n.exec_lua
+local feed = n.feed
+local api = n.api
+local pcall_err = t.pcall_err
+local assert_alive = n.assert_alive
local mousemodels = { 'extend', 'popup', 'popup_setpos' }
@@ -27,38 +29,38 @@ describe('statuscolumn', function()
[[set stc=%{v:relnum?v:relnum:(v:lnum==5?'truncate':v:lnum)}%{!v:relnum&&v:lnum==5?invalid:''}\ ]]
)
screen:expect([[
- 4 aaaaa |
- 3 aaaaa |
- 2 aaaaa |
- 1 aaaaa |
- 8 ^aaaaa |
- 1 aaaaa |
- 2 aaaaa |
- 3 aaaaa |
- 4 aaaaa |
- 5 aaaaa |
- 6 aaaaa |
- 7 aaaaa |
- 8 aaaaa |
+ {8:4 }aaaaa |
+ {8:3 }aaaaa |
+ {8:2 }aaaaa |
+ {8:1 }aaaaa |
+ {8:8 }^aaaaa |
+ {8:1 }aaaaa |
+ {8:2 }aaaaa |
+ {8:3 }aaaaa |
+ {8:4 }aaaaa |
+ {8:5 }aaaaa |
+ {8:6 }aaaaa |
+ {8:7 }aaaaa |
+ {8:8 }aaaaa |
|
]])
command('norm 5G')
eq('Vim(redraw):E121: Undefined variable: invalid', pcall_err(command, 'redraw!'))
eq('', eval('&statuscolumn'))
screen:expect([[
- 4 aaaaa |
- 5 ^aaaaa |
- 6 aaaaa |
- 7 aaaaa |
- 8 aaaaa |
- 9 aaaaa |
- 10 aaaaa |
- 11 aaaaa |
- 12 aaaaa |
- 13 aaaaa |
- 14 aaaaa |
- 15 aaaaa |
- 16 aaaaa |
+ {8: 4 }aaaaa |
+ {8: 5 }^aaaaa |
+ {8: 6 }aaaaa |
+ {8: 7 }aaaaa |
+ {8: 8 }aaaaa |
+ {8: 9 }aaaaa |
+ {8:10 }aaaaa |
+ {8:11 }aaaaa |
+ {8:12 }aaaaa |
+ {8:13 }aaaaa |
+ {8:14 }aaaaa |
+ {8:15 }aaaaa |
+ {8:16 }aaaaa |
|
]])
end)
@@ -72,9 +74,9 @@ describe('statuscolumn', function()
norm 5G | redraw!
]=])
screen:expect([[
- 1 aaaaa virt_text |
- bbbbba^eaaa |
- 1 aaaaa |
+ {8:1 }aaaaa virt_text |
+ {8:bbbbb}a^eaaa |
+ {8:1 }aaaaa |
|
]])
-- Doesn't crash when trying to fill click defs that do not fit (#26845)
@@ -84,9 +86,9 @@ describe('statuscolumn', function()
norm 5Gzt | redraw!
]=])
screen:expect([[
- bbbbba^eaaa |
- 1 aaaaa |
- 2 aaaaa |
+ {8:bbbbb}a^eaaa |
+ {8:1 }aaaaa |
+ {8:2 }aaaaa |
|
]])
end)
@@ -94,19 +96,19 @@ describe('statuscolumn', function()
it("works with 'number' and 'relativenumber'", function()
command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]])
screen:expect([[
- 4 │aaaaa |
- 5 │aaaaa |
- 6 │aaaaa |
- 7 │aaaaa |
- 8 │^aaaaa |
- 9 │aaaaa |
- 10│aaaaa |
- 11│aaaaa |
- 12│aaaaa |
- 13│aaaaa |
- 14│aaaaa |
- 15│aaaaa |
- 16│aaaaa |
+ {8:4 │}aaaaa |
+ {8:5 │}aaaaa |
+ {8:6 │}aaaaa |
+ {8:7 │}aaaaa |
+ {8:8 │}^aaaaa |
+ {8:9 │}aaaaa |
+ {8:10│}aaaaa |
+ {8:11│}aaaaa |
+ {8:12│}aaaaa |
+ {8:13│}aaaaa |
+ {8:14│}aaaaa |
+ {8:15│}aaaaa |
+ {8:16│}aaaaa |
|
]])
command([[set stc=%l%=%{&rnu?'\ ':''}%r│]])
@@ -114,39 +116,19 @@ describe('statuscolumn', function()
command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]])
command('set relativenumber')
screen:expect([[
- 4 4│aaaaa |
- 5 3│aaaaa |
- 6 2│aaaaa |
- 7 1│aaaaa |
- 8 0│^aaaaa |
- 9 1│aaaaa |
- 10 2│aaaaa |
- 11 3│aaaaa |
- 12 4│aaaaa |
- 13 5│aaaaa |
- 14 6│aaaaa |
- 15 7│aaaaa |
- 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 1│aaaaa |
- 6 2│aaaaa |
- 7 3│aaaaa |
- 8 4│aaaaa |
- 9 5│aaaaa |
- 10 6│aaaaa |
- 11 7│aaaaa |
- 12 8│aaaaa |
- 13 9│aaaaa |
- 14 10│aaaaa |
- 15 11│aaaaa |
- 16 12│aaaaa |
+ {8:4 4│}aaaaa |
+ {8:5 3│}aaaaa |
+ {8:6 2│}aaaaa |
+ {8:7 1│}aaaaa |
+ {8:8 0│}^aaaaa |
+ {8:9 1│}aaaaa |
+ {8:10 2│}aaaaa |
+ {8:11 3│}aaaaa |
+ {8:12 4│}aaaaa |
+ {8:13 5│}aaaaa |
+ {8:14 6│}aaaaa |
+ {8:15 7│}aaaaa |
+ {8:16 8│}aaaaa |
|
]])
command([[set stc=%l%=%{&rnu?'\ ':''}%r│]])
@@ -160,58 +142,54 @@ describe('statuscolumn', function()
.. [[%=%{&rnu&&(v:lnum%2)?'\ '.v:relnum:''}]]
.. [[%#LineNr#%{&rnu&&!(v:lnum%2)?'\ '.v:relnum:''}│]]
)
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { foreground = Screen.colors.Brown },
- })
screen:expect([[
- {0:4 }{1:│}aaaaa |
- {0:5 }{1:│}aaaaa |
- {0:6 }{1:│}aaaaa |
- {0:7 }{1:│}aaaaa |
- {0:8 }{1:│}^aaaaa |
- {0:9 }{1:│}aaaaa |
- {0:10}{1:│}aaaaa |
- {0:11}{1:│}aaaaa |
- {0:12}{1:│}aaaaa |
- {0:13}{1:│}aaaaa |
- {0:14}{1:│}aaaaa |
- {0:15}{1:│}aaaaa |
- {0:16}{1:│}aaaaa |
+ {1:4 }{8:│}aaaaa |
+ {1:5 }{8:│}aaaaa |
+ {1:6 }{8:│}aaaaa |
+ {1:7 }{8:│}aaaaa |
+ {1:8 }{8:│}^aaaaa |
+ {1:9 }{8:│}aaaaa |
+ {1:10}{8:│}aaaaa |
+ {1:11}{8:│}aaaaa |
+ {1:12}{8:│}aaaaa |
+ {1:13}{8:│}aaaaa |
+ {1:14}{8:│}aaaaa |
+ {1:15}{8:│}aaaaa |
+ {1:16}{8:│}aaaaa |
|
]])
command('set relativenumber')
screen:expect([[
- {0:4 }{1: 4│}aaaaa |
- {0:5 3}{1:│}aaaaa |
- {0:6 }{1: 2│}aaaaa |
- {0:7 1}{1:│}aaaaa |
- {0:8 }{1: 0│}^aaaaa |
- {0:9 1}{1:│}aaaaa |
- {0:10}{1: 2│}aaaaa |
- {0:11 3}{1:│}aaaaa |
- {0:12}{1: 4│}aaaaa |
- {0:13 5}{1:│}aaaaa |
- {0:14}{1: 6│}aaaaa |
- {0:15 7}{1:│}aaaaa |
- {0:16}{1: 8│}aaaaa |
+ {1:4 }{8: 4│}aaaaa |
+ {1:5 3}{8:│}aaaaa |
+ {1:6 }{8: 2│}aaaaa |
+ {1:7 1}{8:│}aaaaa |
+ {1:8 }{8: 0│}^aaaaa |
+ {1:9 1}{8:│}aaaaa |
+ {1:10}{8: 2│}aaaaa |
+ {1:11 3}{8:│}aaaaa |
+ {1:12}{8: 4│}aaaaa |
+ {1:13 5}{8:│}aaaaa |
+ {1:14}{8: 6│}aaaaa |
+ {1:15 7}{8:│}aaaaa |
+ {1:16}{8: 8│}aaaaa |
|
]])
command('set nonumber')
screen:expect([[
- {1:4│}aaaaa |
- {0:3}{1:│}aaaaa |
- {1:2│}aaaaa |
- {0:1}{1:│}aaaaa |
- {1:0│}^aaaaa |
- {0:1}{1:│}aaaaa |
- {1:2│}aaaaa |
- {0:3}{1:│}aaaaa |
- {1:4│}aaaaa |
- {0:5}{1:│}aaaaa |
- {1:6│}aaaaa |
- {0:7}{1:│}aaaaa |
- {1:8│}aaaaa |
+ {8:4│}aaaaa |
+ {1:3}{8:│}aaaaa |
+ {8:2│}aaaaa |
+ {1:1}{8:│}aaaaa |
+ {8:0│}^aaaaa |
+ {1:1}{8:│}aaaaa |
+ {8:2│}aaaaa |
+ {1:3}{8:│}aaaaa |
+ {8:4│}aaaaa |
+ {1:5}{8:│}aaaaa |
+ {8:6│}aaaaa |
+ {1:7}{8:│}aaaaa |
+ {8:8│}aaaaa |
|
]])
end)
@@ -259,7 +237,7 @@ describe('statuscolumn', function()
{2: }{1: │ }aaaaa |
{0:>!}{2: }{1: 5│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │ }aaaaa |
- {1:>>}{0:>!}{1: 6│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {0:>!}{1:>> 6│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │ }aaaaa |
{2: }{1: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │ }aaaaa |
@@ -278,7 +256,7 @@ describe('statuscolumn', function()
{2: }{1: │}{2: }{1: }aaaaaa |
{2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 6│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {2: }{1: 6│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
{2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
@@ -295,7 +273,7 @@ describe('statuscolumn', function()
{2: }{1: │}{2: }{1: }aaaaaa |
{2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 6│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {2: }{1: 6│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
{2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
@@ -313,7 +291,7 @@ describe('statuscolumn', function()
{2: }{1: 4│}{2: }{1: }aaaaaa |
{2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 5│}{2: }{1: }aaaaaa |
- {2: }{1: 6│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {2: }{1: 6│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 6│}{2: }{1: }aaaaaa |
{2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 7│}{2: }{1: }aaaaaa |
@@ -331,7 +309,7 @@ describe('statuscolumn', function()
{2: }{1: 4│}{2: }{1: }aaaaaa |
{2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 3│}{2: }{1: }aaaaaa |
- {2: }{1: 2│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {2: }{1: 2│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 2│}{2: }{1: }aaaaaa |
{2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 1│}{2: }{1: }aaaaaa |
@@ -348,7 +326,7 @@ describe('statuscolumn', function()
{2: }{1: │}{2: }{1: }aaaaaa |
{2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 2│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {2: }{1: 2│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
{2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: │}{2: }{1: }aaaaaa |
@@ -552,15 +530,11 @@ describe('statuscolumn', function()
it('does not corrupt the screen with minwid sign item', function()
screen:try_resize(screen._width, 3)
- screen:set_default_attr_ids({
- [0] = { foreground = Screen.colors.Brown },
- [1] = { foreground = Screen.colors.Blue4, background = Screen.colors.Gray },
- })
command([[set stc=%6s\ %l]])
exec_lua('vim.api.nvim_buf_set_extmark(0, ns, 7, 0, {sign_text = "𒀀"})')
screen:expect([[
- {0: 𒀀 8 }^aaaaa |
- {0: }{1: }{0: 9 }aaaaa |
+ {8: 𒀀 8 }^aaaaa |
+ {8: }{7: }{8: 9 }aaaaa |
|
]])
end)
@@ -735,19 +709,19 @@ describe('statuscolumn', function()
virt_lines_leftcol = true, virt_lines = {{{"virt", ""}}} })
]])
screen:expect([[
- 4 aaaaa |
- 5 aaaaa |
- 6 aaaaa |
- 7 aaaaa |
+ {7: }{8: 4 }aaaaa |
+ {7: }{8: 5 }aaaaa |
+ {7: }{8: 6 }aaaaa |
+ {7: }{8: 7 }aaaaa |
virt |
- --------- 8 ^aaaaa |
+ {7:---------}{8: 8 }^aaaaa |
virt |
- 𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀 9 aaaaa |
- 10 aaaaa |
- 11 aaaaa |
- 12 aaaaa |
- 13 aaaaa |
- 14 aaaaa |
+ {7:𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀}{8: 9 }aaaaa |
+ {7: }{8:10 }aaaaa |
+ {7: }{8:11 }aaaaa |
+ {7: }{8:12 }aaaaa |
+ {7: }{8:13 }aaaaa |
+ {7: }{8:14 }aaaaa |
|
]])
command('set stc=') -- also for the default fold column
@@ -756,18 +730,18 @@ describe('statuscolumn', function()
command([[set stc=%{foldlevel(v:lnum)>0?repeat('-',foldlevel(v:lnum)):''}%=%l\ ]])
feed('Gd10Ggg<C-l>')
screen:expect([[
- 1 ^aaaaa |
- 2 aaaaa |
- 3 aaaaa |
- 4 aaaaa |
- 5 aaaaa |
- 6 aaaaa |
- 7 aaaaa |
+ {8: 1 }^aaaaa |
+ {8: 2 }aaaaa |
+ {8: 3 }aaaaa |
+ {8: 4 }aaaaa |
+ {8: 5 }aaaaa |
+ {8: 6 }aaaaa |
+ {8: 7 }aaaaa |
virt |
- ---------8 aaaaa |
+ {8:---------8 }aaaaa |
virt |
- ---------9 aaaaa |
- ~ |*2
+ {8:---------9 }aaaaa |
+ {1:~ }|*2
|
]])
end)
@@ -775,15 +749,15 @@ describe('statuscolumn', function()
it('works with cmdwin', function()
feed(':set stc=%l<CR>q:k$')
screen:expect([[
- 7 aaaaa |
- 8 aaaaa |
- 9 aaaaa |
- 10aaaaa |
- [No Name] [+] |
- :1set stc=%^l |
- :2 |
- ~ |*5
- [Command Line] |
+ {8:7 }aaaaa |
+ {8:8 }aaaaa |
+ {8:9 }aaaaa |
+ {8:10}aaaaa |
+ {2:[No Name] [+] }|
+ {1::}{8:1}set stc=%^l |
+ {1::}{8:2} |
+ {1:~ }|*5
+ {3:[Command Line] }|
: |
]])
end)
@@ -794,11 +768,11 @@ describe('statuscolumn', function()
command('set relativenumber')
command([[set stc=%{!&nu&&!&rnu?'':&rnu?v:relnum?v:relnum:&nu?v:lnum:'0':v:lnum}]])
screen:expect([[
- 1 aaaaa |
- 8 ^aaaaa |
- 1 aaaaa |
- 2 aaaaa |
- 3 aaaaa |
+ {8:1 }aaaaa |
+ {8:8 }^aaaaa |
+ {8:1 }aaaaa |
+ {8:2 }aaaaa |
+ {8:3 }aaaaa |
|
]])
-- width correctly estimated with "w_nrwidth_line_count" when setting 'stc'
@@ -815,11 +789,11 @@ describe('statuscolumn', function()
-- width correctly estimated with "w_nrwidth_line_count" when setting 'nu'
command('set number')
screen:expect([[
- 7 aaaaa |
- 8 ^aaaaa |
- 9 aaaaa |
- 10 aaaaa |
- 11 aaaaa |
+ {8:7 }aaaaa |
+ {8:8 }^aaaaa |
+ {8:9 }aaaaa |
+ {8:10 }aaaaa |
+ {8:11 }aaaaa |
|
]])
end)
@@ -846,59 +820,59 @@ describe('statuscolumn', function()
]])
command('sign place 1 line=2 name=sign')
screen:expect([[
- 1 ^aaaaa |
- 2 ssaaaaa |
+ {8:1 }^aaaaa |
+ {8:2 ss}aaaaa |
|
]])
command('sign place 2 line=2 name=sign')
screen:expect([[
- 1 ^aaaaa |
- 2 ssssaaaaa |
+ {8:1 }^aaaaa |
+ {8:2 ssss}aaaaa |
|
]])
command('sign unplace 2')
screen:expect([[
- 1 ^aaaaa |
- 2 ssaaaaa |
+ {8:1 }^aaaaa |
+ {8:2 ss}aaaaa |
|
]])
command('sign unplace 1')
screen:expect([[
- 1 ^aaaaa |
- 2 aaaaa |
+ {8:1 }^aaaaa |
+ {8:2 }aaaaa |
|
]])
-- Also for extmark signs
exec_lua('id1 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})')
screen:expect([[
- 1 ^aaaaa |
- 2 ssaaaaa |
+ {8:1 }^aaaaa |
+ {8:2 ss}aaaaa |
|
]])
exec_lua('id2 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})')
screen:expect([[
- 1 ^aaaaa |
- 2 ssssaaaaa |
+ {8:1 }^aaaaa |
+ {8:2 ssss}aaaaa |
|
]])
exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id1)')
screen:expect([[
- 1 ^aaaaa |
- 2 ssaaaaa |
+ {8:1 }^aaaaa |
+ {8:2 ss}aaaaa |
|
]])
exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id2)')
screen:expect([[
- 1 ^aaaaa |
- 2 aaaaa |
+ {8:1 }^aaaaa |
+ {8:2 }aaaaa |
|
]])
-- In all windows
command('wincmd v | set ls=0')
command('sign place 1 line=2 name=sign')
screen:expect([[
- 1 ^aaaaa │1 aaaaa |
- 2 ssaaaaa │2 ssaaaaa |
+ {8:1 }^aaaaa │{8:1 }aaaaa |
+ {8:2 ss}aaaaa │{8:2 ss}aaaaa |
|
]])
end)
@@ -918,12 +892,16 @@ describe('statuscolumn', function()
it('does not wrap multibyte characters at the end of a line', function()
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('call setline(8, "This is a line that contains ᶏ multibyte character.")')
screen:expect([[
- 8 ^This is a line that contains ᶏ|
- multibyte character. |
- 9 aaaaa |
+ {8:8 }^This is a line that contains {31:ᶏ}|
+ {8: } {31:multibyte} character. |
+ {8:9 }{31:aaaaa} |
|
]])
end)
@@ -934,10 +912,63 @@ describe('statuscolumn', function()
command('call setline(1, range(1, 99))')
feed('Gyyp')
screen:expect([[
- 98 98 |
- 99 99 |
- 100 ^99 |
+ {8:98 }98 |
+ {8:99 }99 |
+ {8:100 }^99 |
|
]])
end)
+
+ it('forces a rebuild with nvim__redraw', function()
+ screen:try_resize(40, 4)
+ -- Current window
+ command([[
+ let g:insert = v:false
+ set nonu stc=%{g:insert?'insert':''}
+ vsplit
+ au InsertEnter * let g:insert = v:true | call nvim__redraw(#{statuscolumn:1, win:0})
+ au InsertLeave * let g:insert = v:false | call nvim__redraw(#{statuscolumn:1, win:0})
+ ]])
+ feed('i')
+ screen:expect({
+ grid = [[
+ {8:insert}^aaaaa │aaaaa |
+ {8:insert}aaaaa │aaaaa |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- INSERT --} |
+ ]],
+ })
+ feed('<esc>')
+ screen:expect({
+ grid = [[
+ ^aaaaa │aaaaa |
+ aaaaa │aaaaa |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]],
+ })
+ -- All windows
+ command([[
+ au! InsertEnter * let g:insert = v:true | call nvim__redraw(#{statuscolumn:1})
+ au! InsertLeave * let g:insert = v:false | call nvim__redraw(#{statuscolumn:1})
+ ]])
+ feed('i')
+ screen:expect({
+ grid = [[
+ {8:insert}^aaaaa │{8:insert}aaaaa |
+ {8:insert}aaaaa │{8:insert}aaaaa |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ {5:-- INSERT --} |
+ ]],
+ })
+ feed('<esc>')
+ screen:expect({
+ grid = [[
+ ^aaaaa │aaaaa |
+ aaaaa │aaaaa |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ |
+ ]],
+ })
+ end)
end)
diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua
index fee4b64d44..3087a0cde1 100644
--- a/test/functional/ui/statusline_spec.lua
+++ b/test/functional/ui/statusline_spec.lua
@@ -1,16 +1,19 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local assert_alive = helpers.assert_alive
-local clear = helpers.clear
-local command = helpers.command
-local feed = helpers.feed
-local eq = helpers.eq
-local fn = helpers.fn
-local api = helpers.api
-local exec = helpers.exec
-local exec_lua = helpers.exec_lua
-local eval = helpers.eval
+
+local assert_alive = n.assert_alive
+local clear = n.clear
+local command = n.command
+local feed = n.feed
+local eq = t.eq
+local fn = n.fn
+local api = n.api
+local exec = n.exec
+local exec_lua = n.exec_lua
+local eval = n.eval
local sleep = vim.uv.sleep
+local pcall_err = t.pcall_err
local mousemodels = { 'extend', 'popup', 'popup_setpos' }
@@ -474,6 +477,25 @@ describe('global statusline', function()
|
]])
end)
+
+ it('horizontal separators unchanged when failing to split-move window', function()
+ exec([[
+ botright split
+ let &winwidth = &columns
+ let &winminwidth = &columns
+ ]])
+ eq('Vim(wincmd):E36: Not enough room', pcall_err(command, 'wincmd L'))
+ command('mode')
+ screen:expect([[
+ |
+ {1:~ }|*5
+ ────────────────────────────────────────────────────────────|
+ ^ |
+ {1:~ }|*6
+ {2:[No Name] 0,0-1 All}|
+ |
+ ]])
+ end)
end)
it('statusline does not crash if it has Arabic characters #19447', function()
@@ -576,57 +598,59 @@ it('statusline is redrawn on various state changes', function()
command('set ls=2 stl=%{repeat(reg_recording(),5)}')
screen:expect([[
^ |
- ~ |
- |*2
+ {1:~ }|
+ {3: }|
+ |
]])
feed('qQ')
screen:expect([[
^ |
- ~ |
- QQQQQ |
- recording @Q |
+ {1:~ }|
+ {3:QQQQQ }|
+ {5:recording @Q} |
]])
feed('q')
screen:expect([[
^ |
- ~ |
- |*2
+ {1:~ }|
+ {3: }|
+ |
]])
-- Visual mode change #23932
command('set ls=2 stl=%{mode(1)}')
screen:expect([[
^ |
- ~ |
- n |
+ {1:~ }|
+ {3:n }|
|
]])
feed('v')
screen:expect([[
^ |
- ~ |
- v |
- -- VISUAL -- |
+ {1:~ }|
+ {3:v }|
+ {5:-- VISUAL --} |
]])
feed('V')
screen:expect([[
^ |
- ~ |
- V |
- -- VISUAL LINE -- |
+ {1:~ }|
+ {3:V }|
+ {5:-- VISUAL LINE --} |
]])
feed('<C-V>')
screen:expect([[
^ |
- ~ |
- ^V |
- -- VISUAL BLOCK -- |
+ {1:~ }|
+ {3:^V }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('<Esc>')
screen:expect([[
^ |
- ~ |
- n |
+ {1:~ }|
+ {3:n }|
|
]])
end)
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua
index 5afc7dfe6c..be35e9bf4f 100644
--- a/test/functional/ui/syntax_conceal_spec.lua
+++ b/test/functional/ui/syntax_conceal_spec.lua
@@ -1,10 +1,12 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, command = helpers.clear, helpers.feed, helpers.command
-local eq = helpers.eq
-local insert = helpers.insert
-local poke_eventloop = helpers.poke_eventloop
-local exec = helpers.exec
+
+local clear, feed, command = n.clear, n.feed, n.command
+local eq = t.eq
+local insert = n.insert
+local poke_eventloop = n.poke_eventloop
+local exec = n.exec
describe('Screen', function()
local screen
@@ -435,6 +437,18 @@ describe('Screen', function()
{0:~ }|*3
|
]])
+
+ feed('r')
+ screen:expect_unchanged()
+
+ feed('m')
+ screen:expect([[
+ ^moo {1:b} bar {1:b} eggs |
+ foo {1:b} bar {1:b} eggs |*4
+ |
+ {0:~ }|*3
+ |
+ ]])
end)
it('and open line', function()
diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua
index 1c90b17e57..5cda70df21 100644
--- a/test/functional/ui/tabline_spec.lua
+++ b/test/functional/ui/tabline_spec.lua
@@ -1,9 +1,11 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, command, eq = helpers.clear, helpers.command, helpers.eq
-local insert = helpers.insert
-local api = helpers.api
-local assert_alive = helpers.assert_alive
+
+local clear, command, eq = n.clear, n.command, t.eq
+local insert = n.insert
+local api = n.api
+local assert_alive = n.assert_alive
describe('ui/ext_tabline', function()
local screen
@@ -31,7 +33,7 @@ describe('ui/ext_tabline', function()
screen:expect {
grid = [[
^ |
- ~ |*3
+ {1:~ }|*3
|
]],
condition = function()
@@ -44,7 +46,7 @@ describe('ui/ext_tabline', function()
screen:expect {
grid = [[
^ |
- ~ |*3
+ {1:~ }|*3
|
]],
condition = function()
@@ -62,7 +64,7 @@ describe('ui/ext_tabline', function()
screen:expect {
grid = [[
^ |
- ~ |*3
+ {1:~ }|*3
|
]],
condition = function()
@@ -81,7 +83,7 @@ describe('ui/ext_tabline', function()
screen:expect {
grid = [[
^ |
- ~ |*3
+ {1:~ }|*3
|
]],
condition = function()
@@ -99,10 +101,6 @@ describe('tabline', function()
clear()
screen = Screen.new(42, 5)
screen:attach()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
- [1] = { reverse = true }, -- TabLineFill
- })
end)
it('redraws when tabline option is set', function()
@@ -110,18 +108,18 @@ describe('tabline', function()
command('set showtabline=2')
screen:expect {
grid = [[
- {1:asdf }|
+ {2:asdf }|
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
}
command('set tabline=jkl')
screen:expect {
grid = [[
- {1:jkl }|
+ {2:jkl }|
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
}
@@ -141,9 +139,9 @@ describe('tabline', function()
api.nvim_set_option_value('tabline', '%1T口口%2Ta' .. ('b'):rep(38) .. '%999Xc', {})
screen:expect {
grid = [[
- {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ {2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^1 |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
}
@@ -151,27 +149,27 @@ describe('tabline', function()
api.nvim_input_mouse('left', 'press', '', 0, 0, 1)
screen:expect {
grid = [[
- {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ {2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^2 |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
}
api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
screen:expect {
grid = [[
- {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ {2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^1 |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
}
api.nvim_input_mouse('left', 'press', '', 0, 0, 39)
screen:expect {
grid = [[
- {1:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
+ {2:<abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc }|
tab^2 |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
}
@@ -179,7 +177,7 @@ describe('tabline', function()
screen:expect {
grid = [[
tab^1 |
- {0:~ }|*3
+ {1:~ }|*3
|
]],
}
diff --git a/test/functional/ui/title_spec.lua b/test/functional/ui/title_spec.lua
index 8060d3a460..e86fdbe5a3 100644
--- a/test/functional/ui/title_spec.lua
+++ b/test/functional/ui/title_spec.lua
@@ -1,14 +1,16 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local curwin = helpers.api.nvim_get_current_win
-local eq = helpers.eq
-local exec_lua = helpers.exec_lua
-local feed = helpers.feed
-local fn = helpers.fn
-local api = helpers.api
-local is_os = helpers.is_os
+
+local clear = n.clear
+local command = n.command
+local curwin = n.api.nvim_get_current_win
+local eq = t.eq
+local exec_lua = n.exec_lua
+local feed = n.feed
+local fn = n.fn
+local api = n.api
+local is_os = t.is_os
describe('title', function()
local screen
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index 667dd64d62..0feec6bd03 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -1,19 +1,28 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, command = helpers.clear, helpers.feed, helpers.command
-local fn = helpers.fn
-local api = helpers.api
-local eq = helpers.eq
-local eval = helpers.eval
-local retry = helpers.retry
-local testprg = helpers.testprg
-local is_os = helpers.is_os
+
+local clear, feed, command = n.clear, n.feed, n.command
+local fn = n.fn
+local api = n.api
+local eq = t.eq
+local eval = n.eval
+local retry = t.retry
+local testprg = n.testprg
+local is_os = t.is_os
describe("'wildmenu'", function()
local screen
before_each(function()
clear()
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()
end)
@@ -105,14 +114,14 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |*2
- define jump list > |
+ {1:~ }|*2
+ {31:define}{3: jump list > }|
:sign define^ |
]])
feed('<C-E>')
screen:expect([[
|
- ~ |*3
+ {1:~ }|*3
:sign ^ |
]])
end)
@@ -121,14 +130,14 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |*2
- define jump list > |
+ {1:~ }|*2
+ {31:define}{3: jump list > }|
:sign define^ |
]])
feed('<tab><C-Y>')
screen:expect([[
|
- ~ |*3
+ {1:~ }|*3
:sign jump^ |
]])
end)
@@ -138,8 +147,8 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |*2
- define jump list > |
+ {1:~ }|*2
+ {31:define}{3: jump list > }|
:sign define^ |
]])
end)
@@ -152,15 +161,15 @@ describe("'wildmenu'", function()
feed(':sign <tab>')
screen:expect([[
|
- ~ |*2
- define jump list > |
+ {1:~ }|*2
+ {31:define}{3: jump list > }|
:sign define^ |
]])
feed('<space>')
screen:expect([[
|
- ~ |*2
- [No Name] |
+ {1:~ }|*2
+ {3:[No Name] }|
:sign define ^ |
]])
end)
@@ -170,16 +179,16 @@ describe("'wildmenu'", function()
feed(':j<Tab><Tab><Tab>')
screen:expect([[
|
- ~ |*2
- join jumps |
+ {1:~ }|*2
+ {3:join jumps }|
:j^ |
]])
-- This would cause nvim to crash before #6650
feed('<BS><Tab>')
screen:expect([[
|
- ~ |*2
- ! # & < = > @ > |
+ {1:~ }|*2
+ {31:!}{3: # & < = > @ > }|
:!^ |
]])
end)
@@ -192,7 +201,7 @@ describe("'wildmenu'", function()
feed([[:sign <Tab>]]) -- Invoke wildmenu.
-- NB: in earlier versions terminal output was redrawn during cmdline mode.
-- 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()
-- cmdline CTRL-D display should also be preserved.
@@ -222,8 +231,8 @@ describe("'wildmenu'", function()
screen:expect {
grid = [[
|
- ~ |*2
- define jump list > |
+ {1:~ }|*2
+ {31:define}{3: jump list > }|
:sign define^ |
]],
}
@@ -252,7 +261,7 @@ describe("'wildmenu'", function()
feed([[:<Tab>]]) -- Invoke wildmenu.
-- Check only the last 2 lines, because the shell output is
-- 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.
-- So make it reasonable.
screen:expect_unchanged(false, 1000)
@@ -266,27 +275,29 @@ describe("'wildmenu'", function()
command('set showtabline=2')
feed(':set wildm<tab>')
screen:expect([[
- [No Name] |
- |
- ~ |
+ {5: [No Name] }{2: }|
|
+ {1:~ }|
+ {3: }|
:set wildm |
wildmenu wildmode |
:set wildm^ |
]])
feed('<tab>') -- trigger wildmode full
screen:expect([[
- [No Name] |
- |*2
+ {5: [No Name] }{2: }|
+ |
+ {3: }|
:set wildm |
- wildmenu wildmode |*2
+ wildmenu wildmode |
+ {31:wildmenu}{3: wildmode }|
:set wildmenu^ |
]])
feed('<Esc>')
screen:expect([[
- [No Name] |
+ {5: [No Name] }{2: }|
^ |
- ~ |*4
+ {1:~ }|*4
|
]])
end)
@@ -301,14 +312,14 @@ describe("'wildmenu'", function()
feed(':sign u<tab>')
screen:expect([[
|
- ~ |*5
+ {1:~ }|*5
:sign un^ |
]])
feed('<tab>') -- trigger wildmode list
screen:expect([[
|
- ~ |*2
- |
+ {1:~ }|*2
+ {3: }|
:sign un |
undefine unplace |
:sign un^ |
@@ -316,7 +327,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |*5
+ {1:~ }|*5
|
]])
@@ -324,8 +335,8 @@ describe("'wildmenu'", function()
feed(':sign un<tab>')
screen:expect([[
|
- ~ |*2
- |
+ {1:~ }|*2
+ {3: }|
:sign un |
undefine unplace |
:sign un^ |
@@ -335,7 +346,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |*5
+ {1:~ }|*5
|
]])
end)
@@ -348,8 +359,8 @@ describe("'wildmenu'", function()
feed(':sign u<tab>')
screen:expect([[
|
- ~ |*2
- |
+ {1:~ }|*2
+ {3: }|
:sign u |
undefine unplace |
:sign u^ |
@@ -357,8 +368,8 @@ describe("'wildmenu'", function()
feed('<tab>') -- trigger wildmode longest
screen:expect([[
|
- ~ |*2
- |
+ {1:~ }|*2
+ {3: }|
:sign u |
undefine unplace |
:sign un^ |
@@ -366,7 +377,7 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |*5
+ {1:~ }|*5
|
]])
end)
@@ -379,15 +390,16 @@ describe("'wildmenu'", function()
feed('<c-d>')
screen:expect([[
|
- ~ |*2
- |
+ {1:~ }|*2
+ {3: }|
:set wildm |
wildmenu wildmode |
:set wildm^ |
]])
feed('<c-d>')
screen:expect([[
- |*2
+ |
+ {3: }|
:set wildm |
wildmenu wildmode |
:set wildm |
@@ -397,8 +409,8 @@ describe("'wildmenu'", function()
feed('<Esc>')
screen:expect([[
^ |
- ~ |*4
- [No Name] |
+ {1:~ }|*4
+ {3:[No Name] }|
|
]])
end)
@@ -594,7 +606,7 @@ describe('ui/ext_wildmenu', function()
screen:expect {
grid = [[
|
- ~ |*3
+ {1:~ }|*3
:sign define^ |
]],
wildmenu_items = expected,
@@ -605,7 +617,7 @@ describe('ui/ext_wildmenu', function()
screen:expect {
grid = [[
|
- ~ |*3
+ {1:~ }|*3
:sign jump^ |
]],
wildmenu_items = expected,
@@ -616,7 +628,7 @@ describe('ui/ext_wildmenu', function()
screen:expect {
grid = [[
|
- ~ |*3
+ {1:~ }|*3
:sign ^ |
]],
wildmenu_items = expected,
@@ -627,7 +639,7 @@ describe('ui/ext_wildmenu', function()
screen:expect {
grid = [[
|
- ~ |*3
+ {1:~ }|*3
:sign define^ |
]],
wildmenu_items = expected,
@@ -638,7 +650,7 @@ describe('ui/ext_wildmenu', function()
screen:expect {
grid = [[
|
- ~ |*3
+ {1:~ }|*3
:sign definea^ |
]],
}
diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua
index c2a52c0f21..fb907026a5 100644
--- a/test/functional/ui/winbar_spec.lua
+++ b/test/functional/ui/winbar_spec.lua
@@ -1,14 +1,16 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local insert = helpers.insert
-local api = helpers.api
-local eq = helpers.eq
-local poke_eventloop = helpers.poke_eventloop
-local feed = helpers.feed
-local fn = helpers.fn
-local pcall_err = helpers.pcall_err
+
+local clear = n.clear
+local command = n.command
+local insert = n.insert
+local api = n.api
+local eq = t.eq
+local poke_eventloop = n.poke_eventloop
+local feed = n.feed
+local fn = n.fn
+local pcall_err = t.pcall_err
describe('winbar', function()
local screen
@@ -525,30 +527,24 @@ describe('local winbar with tabs', function()
clear()
screen = Screen.new(60, 10)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { bold = true },
- [2] = { reverse = true },
- [3] = { bold = true, foreground = Screen.colors.Blue },
- [4] = { underline = true, background = Screen.colors.LightGray },
- })
api.nvim_set_option_value('winbar', 'foo', { scope = 'local', win = 0 })
end)
it('works', function()
command('tabnew')
screen:expect([[
- {4: [No Name] }{1: [No Name] }{2: }{4:X}|
+ {24: [No Name] }{5: [No Name] }{2: }{24:X}|
^ |
- {3:~ }|*7
+ {1:~ }|*7
|
]])
command('tabnext')
screen:expect {
grid = [[
- {1: [No Name] }{4: [No Name] }{2: }{4:X}|
- {1:foo }|
+ {5: [No Name] }{24: [No Name] }{2: }{24:X}|
+ {5:foo }|
^ |
- {3:~ }|*6
+ {1:~ }|*6
|
]],
}
@@ -561,11 +557,11 @@ describe('local winbar with tabs', function()
text]]
screen:expect {
grid = [[
- {1:foo }|
+ {5:foo }|
some |
goofy |
tex^t |
- {3:~ }|*5
+ {1:~ }|*5
|
]],
}
@@ -574,9 +570,9 @@ describe('local winbar with tabs', function()
command 'tabedit'
screen:expect {
grid = [[
- {4: + [No Name] }{1: [No Name] }{2: }{4:X}|
+ {24: + [No Name] }{5: [No Name] }{2: }{24:X}|
^ |
- {3:~ }|*7
+ {1:~ }|*7
|
]],
}
@@ -584,12 +580,12 @@ describe('local winbar with tabs', function()
command 'tabprev'
screen:expect {
grid = [[
- {1: + [No Name] }{4: [No Name] }{2: }{4:X}|
- {1:foo }|
+ {5: + [No Name] }{24: [No Name] }{2: }{24:X}|
+ {5:foo }|
some |
goofy |
tex^t |
- {3:~ }|*4
+ {1:~ }|*4
|
]],
}
@@ -609,16 +605,11 @@ it('winbar works properly when redrawing is postponed #23534', function()
})
local screen = Screen.new(60, 6)
screen:attach()
- screen:set_default_attr_ids({
- [0] = { foreground = Screen.colors.Blue, bold = true },
- [1] = { bold = true },
- [2] = { bold = true, reverse = true },
- })
screen:expect([[
- {1:(winbar) }|
+ {5:(winbar) }|
^ |
- {0:~ }|*2
- {2:(statusline) }|
+ {1:~ }|*2
+ {3:(statusline) }|
|
]])
end)