From 2dff6a8b600b9e3e402f19b231eda554bba728d2 Mon Sep 17 00:00:00 2001 From: kevinhwang91 Date: Mon, 28 Mar 2022 17:14:26 +0800 Subject: [PATCH] fix(misc): kill redundant redraw during incsearch (#485) (#859) --- lua/cmp/utils/misc.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/cmp/utils/misc.lua b/lua/cmp/utils/misc.lua index 7409827..b68bf2e 100644 --- a/lua/cmp/utils/misc.lua +++ b/lua/cmp/utils/misc.lua @@ -206,11 +206,12 @@ end misc.redraw = setmetatable({ doing = false, force = false, + termcode = vim.api.nvim_replace_termcodes('', true, true, true) }, { __call = function(self, force) if vim.tbl_contains({ '/', '?' }, vim.fn.getcmdtype()) then if vim.o.incsearch then - return vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('=""', true, true, true), 'n', true) + return vim.api.nvim_feedkeys(self.termcode, 'in', true) end end