fix(actions): support commands with special chars (#2224)

This commit is contained in:
NAKAI Tsuyoshi
2023-04-26 13:22:53 +09:00
committed by GitHub
parent f2645c1320
commit 713d26b985

View File

@@ -394,13 +394,14 @@ end
local set_edit_line = function(prompt_bufnr, fname, prefix, postfix) local set_edit_line = function(prompt_bufnr, fname, prefix, postfix)
postfix = vim.F.if_nil(postfix, "") postfix = vim.F.if_nil(postfix, "")
postfix = a.nvim_replace_termcodes(postfix, true, false, true)
local selection = action_state.get_selected_entry() local selection = action_state.get_selected_entry()
if selection == nil then if selection == nil then
utils.__warn_no_selection(fname) utils.__warn_no_selection(fname)
return return
end end
actions.close(prompt_bufnr) actions.close(prompt_bufnr)
a.nvim_feedkeys(a.nvim_replace_termcodes(prefix .. selection.value .. postfix, true, false, true), "t", true) a.nvim_feedkeys(prefix .. selection.value .. postfix, "n", true)
end end
--- Set a value in the command line and don't run it, making it editable. --- Set a value in the command line and don't run it, making it editable.