Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add incsearch_redraw_keys settings #1162

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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