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

Code Editor 2: Highlight selection matches - highlight if selection is at least one character, or only whole tokens #9232

Open
gnysek opened this issue Jan 31, 2025 · 2 comments
Labels
feature request New feature (or a request for one)

Comments

@gnysek
Copy link
Contributor

gnysek commented Jan 31, 2025

Is your feature request related to a problem?

There's setting named Highlight selection matches in CE2. However, now it highlight anything that matches not only any selection (from 1 character up), but also 0 characters - where cursor is.

This makes too many highlights IMO, especially when nothing is selected, or when one character is selected (try selecting just a and there will be tons of highlights in code).

Describe the solution you'd like

What I noticed is that putting cursor over var, if and other keywords, doesn't match matching selections, and it happens only for functions and variables. Seems that this system is able to differentiate token type.

Solution A:

  • highlight matches only if whole word is selected. So, for var abcd putting cursor, or only selecting abs will not highlight matching results yet.

Solution B (less proffered, but probably faster to implement):

  • highlight matches only if selection length > 0. So, just putting cursor over any word, doesn't yet highlight anything, making code more readable and causing less blinking.

Describe alternatives you've considered

No response

Additional context

No response

@gnysek gnysek added the feature request New feature (or a request for one) label Jan 31, 2025
@KormexGit
Copy link

Agreed, the current selection match color is really bright so your code is getting lit up like a christmas tree just from moving your cursor around, and it's causing bugs like #9237 too

@PrismaticRealms
Copy link

Yes, I don't think that Highlight Selection Matches should highlight anything if no text is selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature (or a request for one)
Projects
Status: Triage
Development

No branches or pull requests

3 participants