clutcher / bh

Issue tracker for Better Highlights Intellij IDEA plugin
7 stars 0 forks source link

New version seems to re-render every time I move the cursor #104

Closed nanlan2017 closed 5 months ago

nanlan2017 commented 5 months ago

My scenario is editing Vue.js files in WebStorm. For instance, when my cursor is originally on Line 11, the plugin's highlighting is normal. However, when I click the mouse to move the cursor to Line 20, I notice that the previously highlighted portion (not sure if it's done through regex or keywords) briefly but noticeably returns to an unhighlighted state, possibly just for a fraction of a second, before returning to the highlighted state. This happens every time I move the cursor.

clutcher commented 5 months ago

@nanlan2017 Strange, can't reproduce it .

nanlan2017 commented 5 months ago

@clutcher

  1. No, I was just giving an example. Simply moving the cursor could trigger it, I attached a gif. Most of the time it just "blinks" momentarily, but as in the gif, sometimes it fails to coloring. The affected coloring is defined using regex, and it seems to only happen when the file is relatively long. I have defined over 20 regex coloring rules.
  2. I'm using WebStorm 2022.3.4.
  3. My OS is macOS Sonoma 14.4.1.
  4. Other plugins I have installed are listed in below screenshot.
  5. I confirm that when I roll back the plugin version to v2023.8.10, the issue does not occur (even in same long file without any other changes). I think this might be a performance issue, as it seems to occur only with long files. I understand that when the cursor moves (such as when typing a new character), it needs to check matching rules and re-render the coloring. blink2 plugins
clutcher commented 5 months ago

@nanlan2017 Thanks for such detailed report and gif file. It is very helpful.

For rendering is responsible IDE itself and it is pretty smart to not render things, which were not changed. Most probably bug is related to marking something as out to date, what would lead to full rerender of file. I'll dig into that, but not sure how fast I would be able to fix that.

clutcher commented 5 months ago

@nanlan2017 The more I look into it, the more I think that is is issue with WebStorm itself, which they fixed in more recent versions. So my current theory, is that issue existist on all versions of plugin. In 2024.1.1 I added group matching for regexp, which made it a little bit slower, what leads to start seeing that blinking.

Can you check if issue is reproducible for versions 2024.1.0 and 2024.1.2 ? If my theory is right, than on 2024.1.0 there would be no blinking and on version 2024.1.2 you would receive that blinking.

And a side question - do you have plans to update on more recent WebStorm version?

P.S. Just in case there would be no issue with both 2024.1.0 and 2024.1.2, can you also check with 2024.1.4? P.P.S. Plugin developers can't test on WS, so I'm checked on IU 2022.3.3 and can't reproduce it on any of versions of plugin, but from debugger and logs I see that in IU 2022.3 regexp highlighting is triggered almost on each click inside file, while in 2023.3 regexp highlighting is triggered on file modification only.

clutcher commented 5 months ago

@nanlan2017 I spent more time looking into various versions of plugin and Intellij. 99.9% is that root cause of the issue is Intellij itself, moreover it looks like it is set of various bugs, which were fully fixed only in 2024.1 (as I can still find some glitches in 2023.3, especially for regexp with gutter icons).

For version 2022.3 I can't do much. Is it possible for you to update on more recent version, ideally on 2024?

nanlan2017 commented 5 months ago

@clutcher I upgraded WebStorm to version 2024.1 and used the latest version of plugins. The blink issue did not occur. Thank you.

clutcher commented 5 months ago

@nanlan2017 You are welcome. Closing this ticket.