luukvbaal / statuscol.nvim

Status column plugin that provides a configurable 'statuscolumn' and click handlers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin conflicts with `reactive.nvim`

OXY2DEV opened this issue · comments

I have come across a strange bug where the indentation of html files break when using statuscol.nvim and reactive.nvim.

This was the test config I used
Screenshot_2024-02-06-08-21-22-532_com termux-edit

And this is the result
Screenshot_2024-02-06-08-21-08-265_com termux-edit

The bug seems to appear only on html documents and appears even when only setup() is called.

@luukvbaal it appears that in html file statuscol is reporting the wrong indent level(it's `actual_level - statuscol_width)

Can you fix this small bug?

This plugin does not touch the buffer contents whatsoever. I'm not familiar with reactive.nvim but I don't see how they could interfere with each other if it is indeed about indentation. I also don't see what's wrong from the screenshot.

I don't understand what you mean by statuscol reporting an indent level.

Ah is it the cursor position that's wrong after inserting a newline? In any case, I won't be able to look into this until next week.

Ok.

It still is weird how only html files are affected by this.

Anyway, mystery is solved.

This plugin does not touch the buffer contents whatsoever. I'm not familiar with reactive.nvim but I don't see how they could interfere with each other if it is indeed about indentation. I also don't see what's wrong from the screenshot.

Well, neither does reactive.nvim. However both of these plugins change the buffer.

In reactive's case it extracts highlights from all the text.

In statuscol's case it adds a fake column.

Somehow when the plugins are doing their thing(basically after reactive has done it's job) this bug appears.

I can't really say which plugin is responsible or if it's a nvim bug.

But you guys are the experts so maybe something can be done about it.

Ok.

It still is weird how only html files are affected by this.

Anyway, mystery is solved.

I'm still not exactly sure what the issue is, I don't have access to a PC currently so I'm just guessing. But if the issue is a discrepancy between the drawn, and actual cursor position, that will have to be solved in Nvim.

OK I looked into this, it is not just a drawn cursor position discrepancy. The cursor ends up actually indented to the wrong position when 'statuscolumn' is set when using reactive.

The issue happens with a simple :set statuscolumn=%l, and is "resolved" with one of :TSEnable indent, :ReactiveStop or :set stc=.

Closing as this has nothing to do with this plugin, and I have no idea where it goes wrong in the combination of, 'statuscolumn', ts indenting and reactive.nvim.

As 'statuscolumn' is a builtin Neovim feature, I would suggest re-opening rasulomaroff/reactive.nvim#11.

Hi there! Thank you for checking this.
I also have no idea how applying window highlights can cause bugs with indentation. The thing is that during and after the development of reactive I found some bugs in Neovim itself and unfortunately I still haven't found time to open issues in Neovim repo. I'll do as soon as I have time