Skip to content

Commit a621920

Browse files
committed
test(extra): react to Nightly adding of buf field to keymap data
Details: - See PR 38900 in neovim/neovim.
1 parent dfe3092 commit a621920

File tree

3 files changed

+31
-26
lines changed

3 files changed

+31
-26
lines changed

tests/screenshots/tests-test_extra.lua---pickers---keymaps()---works

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
27|│ │
2929
28|│ │
3030
29|│ │
31-
30|└ Keymaps (all) ───────────────────────── 1|11|11 ┘
32-
31|
31+
30|│ │
32+
31|└ Keymaps (all) ───────────────────────── 1|11|11 ┘
33+
32|
3334

3435
--|---------|---------|---------|---------|---------|---------|---------|---------|
3536
01|00000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -61,5 +62,6 @@
6162
27|27777777777777777777777777777777777777777777777777211111111111111111111111111111
6263
28|27777777777777777777777777777777777777777777777777211111111111111111111111111111
6364
29|27777777777777777777777777777777777777777777777777211111111111111111111111111111
64-
30|28888888888888882222222222222222222222222888888888211111111111111111111111111111
65-
31|00000000000000000000000000000000000000000000000000000000000000000000000000000000
65+
30|27777777777777777777777777777777777777777777777777211111111111111111111111111111
66+
31|28888888888888882222222222222222222222222888888888211111111111111111111111111111
67+
32|00000000000000000000000000000000000000000000000000000000000000000000000000000000

tests/screenshots/tests-test_extra.lua---pickers---keymaps()---works-002

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@
1212
11|┌ n @ │ <Space>b │ <Cmd>lua _G.res = "buf"<CR> ─┐
1313
12|│{ │
1414
13|│ abbr = 0, │
15-
14|│ buffer = 1, │
16-
15|│ expr = 0, │
17-
16|│ lhs = " b", │
18-
17|│ lhsraw = " b", │
19-
18|│ lnum = 0, │
20-
19|│ mode = "n", │
21-
20|│ mode_bits = 1, │
22-
21|│ noremap = 0, │
23-
22|│ nowait = 0, │
24-
23|│ replace_keycodes = 0, │
25-
24|│ rhs = '<Cmd>lua _G.res = "buf"<CR>', │
26-
25|│ script = 0, │
27-
26|│ scriptversion = 1, │
28-
27|│ sid = -9, │
29-
28|│ silent = 0 │
30-
29|│} │
31-
30|└ Keymaps (all) ───────────────────────── 1|11|11 ┘
32-
31|
15+
14|│ buf = 1, │
16+
15|│ buffer = 1, │
17+
16|│ expr = 0, │
18+
17|│ lhs = " b", │
19+
18|│ lhsraw = " b", │
20+
19|│ lnum = 0, │
21+
20|│ mode = "n", │
22+
21|│ mode_bits = 1, │
23+
22|│ noremap = 0, │
24+
23|│ nowait = 0, │
25+
24|│ replace_keycodes = 0, │
26+
25|│ rhs = '<Cmd>lua _G.res = "buf"<CR>', │
27+
26|│ script = 0, │
28+
27|│ scriptversion = 1, │
29+
28|│ sid = -9, │
30+
29|│ silent = 0 │
31+
30|│} │
32+
31|└ Keymaps (all) ───────────────────────── 1|11|11 ┘
33+
32|
3334

3435
--|---------|---------|---------|---------|---------|---------|---------|---------|
3536
01|00000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -61,5 +62,6 @@
6162
27|24444444444444444444444444444444444444444444444444211111111111111111111111111111
6263
28|24444444444444444444444444444444444444444444444444211111111111111111111111111111
6364
29|24444444444444444444444444444444444444444444444444211111111111111111111111111111
64-
30|23333333333333332222222222222222222222222333333333211111111111111111111111111111
65-
31|00000000000000000000000000000000000000000000000000000000000000000000000000000000
65+
30|24444444444444444444444444444444444444444444444444211111111111111111111111111111
66+
31|23333333333333332222222222222222222222222333333333211111111111111111111111111111
67+
32|00000000000000000000000000000000000000000000000000000000000000000000000000000000

tests/test_extra.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,7 +2627,7 @@ local setup_keymaps = function()
26272627
end
26282628

26292629
T['pickers']['keymaps()']['works'] = function()
2630-
child.set_size(31, 80)
2630+
child.set_size(32, 80)
26312631
setup_keymaps()
26322632

26332633
child.lua_notify('_G.return_item = MiniExtra.pickers.keymaps()')
@@ -2636,7 +2636,7 @@ T['pickers']['keymaps()']['works'] = function()
26362636

26372637
-- Should have proper preview
26382638
type_keys('<Tab>')
2639-
if child.fn.has('nvim-0.12') == 1 then child.expect_screenshot() end
2639+
if child.fn.has('nvim-0.12.2') == 1 then child.expect_screenshot() end
26402640

26412641
-- Should properly choose by executing LHS keys
26422642
type_keys('<CR>')
@@ -2645,6 +2645,7 @@ T['pickers']['keymaps()']['works'] = function()
26452645
-- Should return chosen value
26462646
local ref_maparg = child.fn.maparg(' b', 'n', false, true)
26472647
ref_maparg.lhs = child.api.nvim_replace_termcodes(ref_maparg.lhs, true, true, true)
2648+
ref_maparg.buf = child.fn.has('nvim-0.12.2') == 1 and 1 or nil
26482649
eq(child.lua_get('_G.return_item'), {
26492650
desc = '<Cmd>lua _G.res = "buf"<CR>',
26502651
lhs = '<Space>b',

0 commit comments

Comments
 (0)