Skip to content

Commit

Permalink
fix(mappings): feed ctrl-o for mappings called from i_ctrl-o. Fixes f…
Browse files Browse the repository at this point in the history
  • Loading branch information
bmesot committed Nov 1, 2024
1 parent 8badb35 commit c254f7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/which-key/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ function M.execute(state, key, node)
if vim.v.register ~= Util.reg() and state.mode.mode ~= "i" and state.mode.mode ~= "c" then
keystr = '"' .. vim.v.register .. keystr
end

local curr_mode = vim.api.nvim_get_mode().mode

if curr_mode:find("ni[IRV]") ~= nil then
keystr = "<C-O>" .. keystr
end
end
Util.debug("feedkeys", tostring(state.mode), keystr)
local feed = vim.api.nvim_replace_termcodes(keystr, true, true, true)
Expand Down

0 comments on commit c254f7f

Please sign in to comment.