mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 01:02:09 +00:00
fix(paste): escape control characters in Cmdline mode
This commit is contained in:
@@ -175,7 +175,8 @@ do
|
||||
if not got_line1 then
|
||||
got_line1 = (#lines > 1)
|
||||
vim.api.nvim_set_option('paste', true) -- For nvim_input().
|
||||
local line1 = lines[1]:gsub('<', '<lt>'):gsub('[\r\n\012\027]', ' ') -- Scrub.
|
||||
-- Escape "<" and control characters
|
||||
local line1 = lines[1]:gsub('<', '<lt>'):gsub('(%c)', '\022%1')
|
||||
vim.api.nvim_input(line1)
|
||||
vim.api.nvim_set_option('paste', false)
|
||||
end
|
||||
|
Reference in New Issue
Block a user