Closed OXY2DEV closed 6 months ago
Hi there! I don't think this is reactive.nvim
issue since the plugin itself doesn't do anything except applying highlights.
I tested on my machine and everything works fine. So, the problem can be in other plugins you have.
https://github.com/rasulomaroff/reactive.nvim/assets/80093436/b26ded36-77e7-4b29-b3a0-ae84a5bfabf9
@OXY2DEV I would suggest trying disabling a half of your plugins and then check if this problem exists. If so, disable another half of remained plugins etc. If the problem is gone, try doing the same in the previously disabled half and find a culprit.
Yep, some other plugin is causing issues with reactive. Let me see if I can find it.
@OXY2DEV I would suggest trying disabling a half of your plugins and then check if this problem exists. If so, disable another half of remained plugins etc. If the problem is gone, try doing the same in the previously disabled half and find a culprit.
Found it. It's statuscol.nvim
. The odd part is this bug only appears when both plugins are enabled, but doesn't if any one of them is disabled.
I was able to reproduce this issue with just :set statuscolumn=%l
. No idea why but setting 'statuscolumn' in combination with this plugin seems to break treesitter indentation. :TSToggle indent
restores the correct behavior at least.
@luukvbaal oh, didn't notice you actually answered here and replied to you in the mentioned issue. Anyway, thank you for you time spent on this!
It becomes even more weird when you realize that I don't do anything with the statuscolumn
option. I attached the video at the beginning showing that everything works perfect without statuscolumn
in my case. And when that option is combined with winhighlight
it somehow breaks TS indents...
Yeah it is weird. TBH it seems unlikely that this plugin is at fault, it just breaks the nvim-treesitter indent module in combination with 'statuscolumn'.
Did some more investigating, commenting out this line "unbreaks" the indentation https://github.com/rasulomaroff/reactive.nvim/blob/c7089808d30ca5c1bfd42eb57d2c3fc43e815190/lua/reactive/highlight.lua#L14
Not too familiar with treesitter but perhaps this redraw somehow incorrectly validates the tree after inserting a newline. No idea how 'statuscolumn' fits into that hypothesis, I'll keep digging 🤷🏻
@luukvbaal there're only 2 places where I would check
redraw
commandwinhighlight
optionI don't remember doing anything else that could somehow affect the neovim's behavior
I believe you have already found the culprit of all of it - redraw
in combination with statuscolumn
(or without?)
Yeah, I was able to reproduce without this plugin by just doing au ModeChanged * redraw!
. Still working on reproducing from --clean
.
No idea why but setting 'statuscolumn' in combination with this plugin seems to break treesitter indentation.
:TSToggle indent
restores the correct behavior at least.
This assumption was wrong btw. I incorrectly assumed treesitter indentation was enabled by default. TSToggle indent
restores correct indentation in the repro because it is enabled.
I suppose the issue is with statuscolumn
, redraw
and the html.vim
indent plugin then... TBH my suggestion would be to just enable treesitter indenting.
Just wanted to add this temporary solution, in case someone stumbled in this same issue.
Setting { indent = { enable = true } }
does fix the issue. However, it somehow disables nvim-cmp
completions. So you also need to install cmp-treesitter
and add it to the source table which fixes it.
Now everything works as intended
raeactive.nvim
is causing issues with the indentation of.html
file.Without![Screenshot_2024-02-05-23-49-34-390_com termux-edit](https://github.com/rasulomaroff/reactive.nvim/assets/122956967/0afff723-95ad-4496-b264-0bc69b9a32ed)
reactive.nvim
With![Screenshot_2024-02-05-22-32-36-233_com termux-edit](https://github.com/rasulomaroff/reactive.nvim/assets/122956967/d1df1590-4698-4a1c-b661-07a4bba957ca)
reactive.nvim
[All plugins were disabled when I tested this]
Is there a particular reason why it only affects
.html
files?Every other file type I had seems to work normally except for this one.