-
Notifications
You must be signed in to change notification settings - Fork 118
Closed as not planned
Labels
bugSomething isn't workingSomething isn't workingstaleThis issue or PR has been inactive for a whileThis issue or PR has been inactive for a while
Description
Did you check docs and existing issues?
- I have read all the todo-comments.nvim docs
- I have searched the existing issues of todo-comments.nvim
- I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.10.0
Operating system/version
MacOS 13.6.3
Describe the bug
When scrolling on a large file with folds there is a very noticeable lag during scrolling. There's a WinScroll autocommand that fires in order to update the window highlights. This works fine if there are no folds since it only processes a few dozen lines but in a large file with folds w0 and w$ can be very far apart and currently it's looping through every single line to add the highlight even though they are not in view. I tried setting the highlight.throttle option to a lower value and it did not help much. (This config value is also not documented). I'm attaching a video of the issue happening.
Screen.Recording.2024-07-02.at.2.46.00.PM.mov
Steps To Reproduce
- Open a large file (in my case it was a tree-sitter src/parser.c file)
- Fold all code blocks
- Scroll through the file
Expected Behavior
Ideally todo-comments wouldn't process all these folded lines that are not in view.
Repro
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/todo-comments.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else heredomi413
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstaleThis issue or PR has been inactive for a whileThis issue or PR has been inactive for a while