Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
haolian9 opened this issue Jun 23, 2021 · 4 comments · Fixed by #22
Closed

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

haolian9 opened this issue Jun 23, 2021 · 4 comments · Fixed by #22
Labels
enhancement New feature or request

Comments

@haolian9
Copy link

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:

  • stay in a keyword in &updattime, so we have a set of usage highlight
  • refactor.navigation.goto_next_usage or goto_previous_usage or just hl in the keyword
  • highlight cleared, after waiting &updatetime, hightlighted again

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.

@haolian9 haolian9 added the enhancement New feature or request label Jun 23, 2021
stsewd added a commit to stsewd/nvim-treesitter-refactor that referenced this issue Jun 25, 2021
@stsewd
Copy link
Member

stsewd commented Jun 25, 2021

Hi, I have implemented something like what you described in #22.

@haolian9
Copy link
Author

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

@haolian9
Copy link
Author

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

@haolian9
Copy link
Author

haolian9 commented Jul 24, 2021

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

  • auto_highlight = false
  • keymap = { highlight_usages = false, clear_usage_highlights = false }

i made a commit to implement it in my fork.

stsewd added a commit to stsewd/nvim-treesitter-refactor that referenced this issue Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants