Add incsearch_redraw_keys settings (#1162)

This commit is contained in:
yuki yano
2022-08-31 12:42:43 +09:00
committed by GitHub
parent 058100d813
commit b5885696b1

View File

@@ -226,12 +226,13 @@ misc.redraw = setmetatable({
doing = false, doing = false,
force = false, force = false,
-- We use `<Up><Down>` to redraw the screen. (Previously, We use <C-r><ESC>. it will remove the unmatches search history.) -- 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) __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.tbl_contains({ '/', '?' }, vim.fn.getcmdtype()) then
if vim.o.incsearch 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
end end