Skip to content

Commit

Permalink
fix: fixed flickering during substitute & cmdpreview
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 16, 2022
1 parent 4911d84 commit 1702772
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/noice/util/hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,13 @@ function M.fix_cmp()
end)
end

local was_in_cmdline = false
function M.cmdline_force_redraw()
local ffi = require("noice.util.ffi")
if ffi.cmdpreview then
local pos = vim.fn.getcmdpos()
local in_cmdline = pos < #vim.fn.getcmdline() + 1
if ffi.cmdpreview and (in_cmdline or was_in_cmdline) then
was_in_cmdline = in_cmdline
-- HACK: this will trigger redraw during substitute and cmdpreview,
-- but when moving the cursor, the screen will be cleared until
-- a new character is entered
Expand Down

0 comments on commit 1702772

Please sign in to comment.