mirror of
https://github.com/neovim/neovim.git
synced 2026-11-02 20:30:40 -06:00
fix(cmdwin): handle UTF-8 characters containing 0x80 #41566
Problem: Confirming cmdwin with a UTF-8 character containing 0x80 does not complete the command. Solution: Escape K_SPECIAL bytes while feeding the cmdwin input after confirmation.
This commit is contained in:
1 parent
2b6a09c2f1
commit
ad42ee1c41
2 files changed
+5
-5
No files matched your search
@@ -188,7 +188,7 @@ function M.confirm()
|
||||
end
|
||||
local line, type = _close()
|
||||
line = line:gsub('%z', '\n'):gsub('(%c)', '\022%1') -- Escape control characters.
|
||||
vim.api.nvim_feedkeys(type .. line .. vim.keycode('<CR>'), 'nt', false)
|
||||
vim.api.nvim_feedkeys(type .. line .. '\r', 'nt', true)
|
||||
end
|
||||
|
||||
--- Cancel: close the cmdwin and re-enter cmdline mode with the line pre-filled (no execute).
|
||||
@@ -198,7 +198,7 @@ function M.cancel()
|
||||
end
|
||||
local line, type = _close()
|
||||
line = line:gsub('%z', '\n'):gsub('(%c)', '\022%1') -- Escape control characters.
|
||||
vim.api.nvim_feedkeys(type .. line, 'nt', false)
|
||||
vim.api.nvim_feedkeys(type .. line, 'nt', true)
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in new issue
Block a user