fix(misc): kill redundant redraw during incsearch (#485) (#859)

This commit is contained in:
kevinhwang91
2022-03-28 17:14:26 +08:00
committed by GitHub
parent 272cbdca3e
commit 2dff6a8b60

View File

@@ -206,11 +206,12 @@ end
misc.redraw = setmetatable({ misc.redraw = setmetatable({
doing = false, doing = false,
force = false, force = false,
termcode = vim.api.nvim_replace_termcodes('<C-r><Esc>', true, true, true)
}, { }, {
__call = function(self, force) __call = function(self, force)
if vim.tbl_contains({ '/', '?' }, vim.fn.getcmdtype()) then if vim.tbl_contains({ '/', '?' }, vim.fn.getcmdtype()) then
if vim.o.incsearch then if vim.o.incsearch then
return vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-r>=""<CR>', true, true, true), 'n', true) return vim.api.nvim_feedkeys(self.termcode, 'in', true)
end end
end end