nvim-treesitter / nvim-treesitter-refactor

Refactor module for nvim-treesitter
Apache License 2.0
398 stars 25 forks source link

keeps usages highlight un-cleared, when cursor moves among sibiling usage node #21

Closed haolian9 closed 2 years ago

haolian9 commented 3 years ago

as now, every time CursorMoved, refactor.highlight_usages will clear_usage_highlights(); this behavior is fine, except when the cursor moves among same usage node (i dont known the exact name to describe it), let's consider the following type flow:

it is very inefficient, and highlight blinks (unless set &updatetime a small value) leads a bad experience.

can we keep the highlight highlighting when the usage node has not changed after cursor moved.

stsewd commented 3 years ago

Hi, I have implemented something like what you described in https://github.com/nvim-treesitter/nvim-treesitter-refactor/pull/22.

haolian9 commented 3 years ago

I have tested it, really nice, highlight works more fluent now. :thumbsup:

haolian9 commented 3 years ago

I left some comments on that pr without permission, sorry for my rude. @stsewd

haolian9 commented 3 years ago

after all those days use, i found i did not need a smart or automatic definition highlighter, so I added some options to nvim-treesitter-refactor.highlight_definitions

i made a commit to implement it in my fork.