Skip to content

Commit

Permalink
Add incsearch_redraw_keys settings (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-yano authored Aug 31, 2022
1 parent 058100d commit b588569
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/cmp/utils/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,13 @@ misc.redraw = setmetatable({
doing = false,
force = false,
-- We use `<Up><Down>` to redraw the screen. (Previously, We use <C-r><ESC>. it will remove the unmatches search history.)
termcode = vim.api.nvim_replace_termcodes('<Up><Down>', true, true, true),
incsearch_redraw_keys = '<Up><Down>',
}, {
__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

Expand Down

0 comments on commit b588569

Please sign in to comment.