Skip to content

Commit

Permalink
fix: removed feedkeys as typed, since some normal mappings stop working
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 14, 2022
1 parent d5f0c63 commit e6a63ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/which-key/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,20 @@ function M.execute(prefix_i, mode, buf)
-- feed CTRL-O again if called from CTRL-O
local full_mode = Util.get_mode()
if full_mode == "nii" or full_mode == "nir" or full_mode == "niv" or full_mode == "vs" then
vim.api.nvim_feedkeys(Util.t("<C-O>"), "nt", false)
vim.api.nvim_feedkeys(Util.t("<C-O>"), "n", false)
end

-- handle registers that were passed when opening the popup
if M.reg ~= '"' and M.mode ~= "i" and M.mode ~= "c" then
vim.api.nvim_feedkeys('"' .. M.reg, "nt", false)
vim.api.nvim_feedkeys('"' .. M.reg, "n", false)
end

if M.count and M.count ~= 0 then
prefix_i = M.count .. prefix_i
end

-- feed the keys with remap
vim.api.nvim_feedkeys(prefix_i, "mt", true)
vim.api.nvim_feedkeys(prefix_i, "m", true)

-- defer hooking WK until after the keys were executed
vim.defer_fn(function()
Expand Down

0 comments on commit e6a63ec

Please sign in to comment.