acejump / AceJump

🅰️ single character search, select, and jump
https://plugins.jetbrains.com/plugin/7086-acejump
GNU General Public License v3.0
1.21k stars 91 forks source link

Do not assign tags inside folded regions #455

Closed chylex closed 9 months ago

chylex commented 9 months ago

Closes #453

Avoids assigning tags to offsets inside folded regions until you unfold them and refine the query.
Since the user may fold a region that already has tags, the PR also:

  1. Ignores tags inside folded regions when typing
  2. Skips rendering tag markers inside folded regions, otherwise it would show tags that cannot be typed

It keeps the search highlights at folded regions so you know they're there, even if it looks a little weird.

image

I didn't see a good way to consolidate the logic for in view and not in folded region, since typing uses Tag / Tagger and calls editor.getView() without any caching, and rendering uses TagMarker with an offset cache to determine what is in view.

breandan commented 9 months ago

Nice work @chylex! I tested this and it works as described. Thanks for keeping the PR small.