Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit dff63f1

Browse files
committed
Use c-@
Signed-off-by: Tomas Slusny <[email protected]>
1 parent fd44d71 commit dff63f1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lua/autocomplete/cmd.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
local M = {}
22

33
function M.setup()
4-
local term = vim.api.nvim_replace_termcodes('<C-z>', true, true, true)
5-
local completing = false
4+
local term = vim.api.nvim_replace_termcodes('<C-@>', true, true, true)
65

76
vim.opt.wildmenu = true
87
vim.opt.wildmode = 'noselect:lastused,full'
@@ -26,13 +25,10 @@ function M.setup()
2625
and last_char:match('[%w%/%: ]')
2726
and not cmdline:match('^%d+$')
2827
then
29-
vim.opt.eventignore:append('CmdlineChanged')
3028
vim.api.nvim_feedkeys(term, 'ti', false)
29+
vim.opt.eventignore:append('CmdlineChanged')
3130
vim.schedule(function()
32-
local current_cmdline = vim.fn.getcmdline()
33-
if current_cmdline:match('\026$') or current_cmdline:match('\x1A$') then
34-
vim.fn.setcmdline(cmdline)
35-
end
31+
vim.fn.setcmdline(vim.fn.substitute(vim.fn.getcmdline(), '\\%x00', '', 'g'))
3632
vim.opt.eventignore:remove('CmdlineChanged')
3733
end)
3834
end

0 commit comments

Comments
 (0)