Skip to content

Commit 0abb662

Browse files
committed
test(cmdline): add test for config.autopeek.window.statuscolumn
1 parent 92cbbd8 commit 0abb662

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--|---------|---------|
2+
01|My tabline
3+
02|Line 1
4+
03|Line 2
5+
04|Line 3
6+
05|Line 4
7+
06|┌ Peek ────────────┐
8+
07|│!1 Line 1 │
9+
08|│!2 Line 2 │
10+
09|│!3 Line 3 │
11+
10|└──────────────────┘
12+
11|:2
13+
14+
--|---------|---------|
15+
01|00000000000000000000
16+
02|11111111111111111111
17+
03|11111111111111111111
18+
04|11111111111111111111
19+
05|11111111111111111111
20+
06|23333332222222222222
21+
07|24444555555555555552
22+
08|24444555555555555552
23+
09|24444555555555555552
24+
10|22222222222222222222
25+
11|66666666666666666666

tests/test_cmdline.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,32 @@ T['Autopeek']['respects `config.autopeek.window.config`'] = function()
15211521
expect_screenshot_after_keys({ ':', '2' })
15221522
end
15231523

1524+
T['Autopeek']['respects `config.autopeek.window.statuscolumn`'] = function()
1525+
child.lua([[
1526+
MiniCmdline.config.autopeek.window.statuscolumn = function(...)
1527+
_G.args = { ... }
1528+
return '!' .. vim.v.lnum
1529+
end
1530+
]])
1531+
1532+
set_cursor(3, 0)
1533+
type_keys(':')
1534+
1535+
local validate = function(key, ref_args)
1536+
type_keys(key)
1537+
eq(child.lua_get('_G.args'), ref_args)
1538+
child.lua('_G.args = nil')
1539+
end
1540+
1541+
validate('2', { { left = 2, right = 2, cmd = '' } })
1542+
child.expect_screenshot()
1543+
1544+
validate(',', { { left = 2, right = 3, cmd = '' } })
1545+
validate('4', { { left = 2, right = 4, cmd = '' } })
1546+
validate('d', { { left = 2, right = 4, cmd = 'delete' } })
1547+
validate('<BS>', { { left = 2, right = 4, cmd = '' } })
1548+
end
1549+
15241550
T['Autopeek']["respects 'winborder'"] = function()
15251551
if child.fn.has('nvim-0.11') == 0 then MiniTest.skip("'winborder' option is present on Neovim>=0.11") end
15261552

0 commit comments

Comments
 (0)