Do not remap when calling feedkeys (closes #258)

When calling vim.fn.feedkeys for commands or searches ,which means it is
prefixed by ":" or "/", one of those keys could be remapped to something
else. Calling feedkeys with "n" means this mapping would be ignored.
This commit is contained in:
Tamir Zahavi-Brunner 2021-12-15 13:04:25 +02:00 committed by ibhagwan
parent 3147d9b170
commit 9421bc225f

View File

@ -246,7 +246,7 @@ end
M.ex_run = function(selected)
local cmd = selected[1]
vim.cmd("stopinsert")
vim.fn.feedkeys(string.format(":%s", cmd))
vim.fn.feedkeys(string.format(":%s", cmd), "n")
return cmd
end
@ -259,7 +259,7 @@ end
M.search = function(selected)
local query = selected[1]
vim.cmd("stopinsert")
vim.fn.feedkeys(string.format("/%s", query))
vim.fn.feedkeys(string.format("/%s", query), "n")
return query
end