Open DOhlsson opened 2 years ago
I am almost certain that this is a bug in neovim core - ref https://github.com/neovim/neovim/issues/14303. In general, there are a number of bad interactions with timers and the underlying neovim event loop - for a workaround, please see what I posted in #40. In the future, I may consider moving redraw logic to use CursorHold
autocommands instead of timers, due to these bad interactions.
I have also this issue, any news about it? Unfortunately I love this plugin but I will need to disable it for now 🤔
I believe this is caused by Bookmarks:refresh()
deleting and re-adding the bookmark signs:
This decoration provider can be used to see when screen redraws are happening:
local redraw = 0
local ns = vim.api.nvim_create_namespace('MarksIssue62')
vim.api.nvim_set_decoration_provider(ns, {
on_start = function()
print(redraw)
redraw = redraw + 1
end
})
Currently it would print a new number every refresh_interval
. Removing the call to Bookmarks:refresh()
from refresh()
stops this.
The problem was in vim.fn.sign_unplace()
, which was causing redraw even when the buffer does not contain bookmarks. This is fixed in neovim/neovim@c4afb9788c4f139eb2e3b7aa4d6a6a20b67ba156.
Though this wouldn't help if the buffer actually contains bookmarks.
First of all, thank you for making this plugin, I find it quite useful.
However, since installing this plugin my neovim has increased in CPU usage by quite a lot, even when idle. A fresh neovim with zero files open uses around 1-2% constantly and after having opened a bunch of projects and working for a while it can use as much as 20% CPU when the window is unfocused and idle.
I did some profiling and noticed that the CPU usage is caused by airline calling fugitive to get the git branch over and over. But I do not believe airline is the culprit. If I disable marks.nvim the behavior disappears, so it appears that marks is causing airline to redraw and refresh the information displayed. I don't know how to profile lua in neovim so I have not been able to find the smoking gun.
Neovim version 0.6.1 marks.nvim latest commit from master (8e80a20) vim-airline latest commit from master (be5bda1)
Profiling for 1 minute with only an empty buffer open and marks installed.
Profiling for 1 minute with only an empty buffer open and marks installed and refresh_interval set to 1000.
Profiling for 1 minute with only an empty buffer open and marks not installed.