Skip to content

Commit b88ed2b

Browse files
committed
test(cmdline): add test for config.autopeek.window.statuscolumn
1 parent 770d47a commit b88ed2b

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
@@ -1520,6 +1520,32 @@ T['Autopeek']['respects `config.autopeek.window.config`'] = function()
15201520
expect_screenshot_after_keys({ ':', '2' })
15211521
end
15221522

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

0 commit comments

Comments
 (0)