From ef5bdb43fabb98a7dd82775acf28d0a361f2bb9e Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Mon, 10 Jan 2022 23:52:23 +0900 Subject: [PATCH] Improve redraw in search mode --- lua/cmp/utils/misc.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/cmp/utils/misc.lua b/lua/cmp/utils/misc.lua index 80aa287..cccd52a 100644 --- a/lua/cmp/utils/misc.lua +++ b/lua/cmp/utils/misc.lua @@ -187,7 +187,9 @@ misc.redraw = setmetatable({ }, { __call = function(self, force) if vim.tbl_contains({ '/', '?' }, vim.fn.getcmdtype()) then - return vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('=""', true, true, true), 'n', true) + if vim.o.incsearch then + return vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('=""', true, true, true), 'n', true) + end end if self.doing then