Skip to content

Commit

Permalink
feat: improve macro performance
Browse files Browse the repository at this point in the history
Only redraw the screen when both 'lazyredraw' is disabled and not executing a macro.
  • Loading branch information
alexmozaidze authored and mawkler committed Jan 17, 2024
1 parent d22c02c commit fad5ba2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/modicator/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,12 @@ M.set_cursor_line_highlight = function(hl_name)
local hl = vim.tbl_extend('force', options.highlights.defaults, hl_group)
api.nvim_set_hl(0, 'CursorLineNr', hl)

local is_register_executing = vim.fn.reg_executing() ~= ""

-- Workaround for https://github.com/neovim/neovim/issues/25851
vim.cmd.redraw()
if not vim.o.lazyredraw and not is_register_executing then
vim.cmd.redraw()
end
end

local function create_autocmds()
Expand Down

0 comments on commit fad5ba2

Please sign in to comment.