From b5885696b1f2cbdc9f523cc09c2a786919de07d5 Mon Sep 17 00:00:00 2001 From: yuki yano Date: Wed, 31 Aug 2022 12:42:43 +0900 Subject: [PATCH] Add incsearch_redraw_keys settings (#1162) --- lua/cmp/utils/misc.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/cmp/utils/misc.lua b/lua/cmp/utils/misc.lua index a322103..1b6f393 100644 --- a/lua/cmp/utils/misc.lua +++ b/lua/cmp/utils/misc.lua @@ -226,12 +226,13 @@ misc.redraw = setmetatable({ doing = false, force = false, -- We use `` to redraw the screen. (Previously, We use . it will remove the unmatches search history.) - termcode = vim.api.nvim_replace_termcodes('', true, true, true), + incsearch_redraw_keys = '', }, { __call = function(self, force) + local termcode = vim.api.nvim_replace_termcodes(self.incsearch_redraw_keys, true, true, true) if vim.tbl_contains({ '/', '?' }, vim.fn.getcmdtype()) then if vim.o.incsearch then - return vim.api.nvim_feedkeys(self.termcode, 'in', true) + return vim.api.nvim_feedkeys(termcode, 'in', true) end end