Skip to content

Commit 917dfbe

Browse files
committed
fix(view): backward compat for older Neovim versions. Fixes #1489
1 parent 24fa2a9 commit 917dfbe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/lazy/view/init.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,14 @@ function M:setup_modes()
297297
end
298298
if m.key_plugin and name ~= "restore" then
299299
self:on_key(m.key_plugin, function()
300-
vim.api.nvim_feedkeys(vim.keycode("<esc>"), "n", false)
300+
local esc = vim.api.nvim_replace_termcodes("<esc>", true, true, true)
301+
vim.api.nvim_feedkeys(esc, "n", false)
301302
local plugins = {}
302303
if vim.api.nvim_get_mode().mode:lower() == "v" then
303304
local f, t = vim.fn.line("."), vim.fn.line("v")
304-
if f > t then f, t = t, f end
305+
if f > t then
306+
f, t = t, f
307+
end
305308
for i = f, t do
306309
plugins[#plugins + 1] = self.render:get_plugin(i)
307310
end

0 commit comments

Comments
 (0)