Skip to content

Commit

Permalink
fix: change nvim_input to nvim_feedkeys for function mappings
Browse files Browse the repository at this point in the history
Thanks @Sam-programs!

Co-authored-by: Sam <130783534+Sam-programs@users.noreply.github.com>
  • Loading branch information
jumpyjacko and Sam-programs committed Jul 12, 2024
1 parent ea38a94 commit ec832a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/better_escape.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,15 @@ local function map_keys()
false
)
elseif type(mapping) == "function" then
vim.api.nvim_input(mapping() or "")
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(
mapping() or "",
true,
false,
true
),
"n",
false)
end
end, map_opts)
::continue::
Expand Down

0 comments on commit ec832a0

Please sign in to comment.