Skip to content

Commit

Permalink
fix(view): backward compat for older Neovim versions. Fixes #1489
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 31, 2024
1 parent 24fa2a9 commit 917dfbe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/lazy/view/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,14 @@ function M:setup_modes()
end
if m.key_plugin and name ~= "restore" then
self:on_key(m.key_plugin, function()
vim.api.nvim_feedkeys(vim.keycode("<esc>"), "n", false)
local esc = vim.api.nvim_replace_termcodes("<esc>", true, true, true)
vim.api.nvim_feedkeys(esc, "n", false)
local plugins = {}
if vim.api.nvim_get_mode().mode:lower() == "v" then
local f, t = vim.fn.line("."), vim.fn.line("v")
if f > t then f, t = t, f end
if f > t then
f, t = t, f
end
for i = f, t do
plugins[#plugins + 1] = self.render:get_plugin(i)
end
Expand Down

0 comments on commit 917dfbe

Please sign in to comment.