Closed drybalka closed 7 months ago
The performance bottleneck here is treesitter, not indent-blankline, there is nothing I can do. You can turn off scope to not use treesitter queries.
Thank you for the quick reply!
Can you please explain a bit more how this is a treesitter issue, so that I could create an issue on their board? Do you by any chance know why treesitter-powered highlighting works without lags, but indent-blankline cannot? And could you please clarify why exactly this is their issue and there is nothing you can do about it, so that they cannot simply dismiss me with "treesitter works without lags for us (highlighting, for example), so the problem must be downstream".
I tried turning off the scope in ibl, as you suggested, but it had no effect on the issue. Do you have any other suggestions?
Can you please explain a bit more how this is a treesitter issue, so that I could create an issue on their board?
The only part in indent-blankline that is related to syntax, such as a big comment, is scope. And scope is handled by treesitter. Indent blankline simply calls treesitter to get the current scope. So if you have performance issues only with big comments, all I can say is that is has to be caused by treesitter. You don't provide enough information for me to say anything more.
Do you by any chance know why treesitter-powered highlighting works without lags, but indent-blankline cannot?
Not the same thing. Treesitter does more than just highlighting. In this case it provides the scope.
Thank you for answering! I will gladly provide you with more information, I just assumed that the minimal config and an example file where this happens would be enough. What else do you need to reproduce the issue? Can you reproduce it at all? I get the same behavior also with the following config, so the issue should not be in the scope feature:
require("ibl").setup({
scope = {
enabled = false,
},
})
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
},
})
And just to clarify, I do not have any issues with the following config:
require("ibl").setup({
enabled = false,
})
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
},
})
And lastly, which is kinda weird, I also do not have any problems when disabling the highlighting in treesitter:
require("ibl").setup({})
require("nvim-treesitter.configs").setup({
highlight = {
enable = false,
},
})
Can you reproduce it at all?
The example you shared does not lag for me, but performance depends on a lot of factors.
I get the same behavior also with the following config, so the issue should not be in the scope feature
There is no other logic in indent-blankline that depends on syntax. If turning off scope doesn't fix it, reevaluate your first assumption that it is caused by comments.
Sorry, I don't want to be dismissive, but "it lags" is just not enough information for me to do anything with.
You can try https://github.com/stevearc/profile.nvim to see where time is spent.
Problem
Moving cursor with any movement lags quite heavily in a file with a large block comment.
Steps to reproduce
min-init.lua
Using this config in a file such as below leads to lags.
large_comment.scala
Expected behavior
Ibl should not lag.
Neovim version (nvim -v)
NVIM v0.9.5