Skip to content

Commit 4d79a1f

Browse files
authored
fix(nes): fix E523 in nes.walk_cursor_start_edit (#46)
* fix(nes): fix E523 in nes.walk_cursor_start_edit * Fix tests
1 parent 041385e commit 4d79a1f

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

lua/copilot-lsp/nes/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ function M.walk_cursor_start_edit(bufnr)
6363
["end"] = state.range["start"],
6464
},
6565
}
66-
return vim.lsp.util.show_document(jump_loc_before, "utf-16", { focus = true })
66+
vim.schedule(function()
67+
vim.lsp.util.show_document(jump_loc_before, "utf-16", { focus = true })
68+
end)
69+
return true
6770
else
6871
return false
6972
end

tests/nes/test_nes.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
local eq = MiniTest.expect.equality
2-
local ref = MiniTest.expect.reference_screenshot
2+
local ref = function(screenshot)
3+
-- ignore the last, 24th line on the screen as it has differing `screenattr` values between stable and nightly
4+
MiniTest.expect.reference_screenshot(screenshot, nil, { ignore_attr = { 24 } })
5+
end
36

47
local child = MiniTest.new_child_neovim()
58

tests/nes/test_ui_preview.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
local ref = MiniTest.expect.reference_screenshot
1+
local ref = function(screenshot)
2+
-- ignore the last, 24th line on the screen as it has differing `screenattr` values between stable and nightly
3+
MiniTest.expect.reference_screenshot(screenshot, nil, { ignore_attr = { 24 } })
4+
end
25
local eq = MiniTest.expect.equality
36

47
local child = MiniTest.new_child_neovim()

tests/test_signin.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
local ref = MiniTest.expect.reference_screenshot
1+
local ref = function(screenshot)
2+
-- ignore the last, 24th line on the screen as it has differing `screenattr` values between stable and nightly
3+
MiniTest.expect.reference_screenshot(screenshot, nil, { ignore_attr = { 24 } })
4+
end
25

36
local child = MiniTest.new_child_neovim()
47

0 commit comments

Comments
 (0)