highlighting variables #8473

kuige opened this Issue Jul 20, 2014 · 14 comments


None yet
8 participants

kuige commented Jul 20, 2014

when click a variable,highlight all the same variables


redmunds commented Jul 20, 2014

Turn on the highlightMatches preference. More details here:

Is that what you're looking for?


JeffryBooher commented Jul 21, 2014

Also try double clicking the variable and pressing Alt+F3. That will highlight all matching instances.

redmunds removed the last reviewed label Jul 28, 2014

pthiess removed the last reviewed label Jul 28, 2014


dangoor commented Aug 4, 2014

Closing due to lack of comment from original reporter.

dangoor closed this Aug 4, 2014


Mark-Simulacrum commented Aug 4, 2014

@dangoor Noticing this after it was closed, I was wondering if I should post further discussion here, or elsewhere?

If here, I think the ALT+F3 shortcut is slightly buggy; test case:

  1. Activate the key bind on variable varName
  2. Expected to see all instances of varName get highlighted, and not varNameOther.

Other option (alternative to ALT+F3 keybind?):
highlightMatches preference option works to some extend, but I would prefer Sublime Text like functionality. Sublime Text highlights all matching symbols when just having the cursor in a variable, unlike Bracket's select-to-highlight.


redmunds commented Aug 4, 2014

Re-opening. Yes, this is the proper place for comments.

redmunds reopened this Aug 4, 2014


peterflynn commented Aug 4, 2014

@Mark-Simulacrum The "Find All and Select" shortcut issue is already covered by #8243.

Re highlightMatches: Are you using ST3? In ST2 I have to select the word before it will highlight other occurrences.


Mark-Simulacrum commented Aug 4, 2014

@peterflynn Yes, using ST3, but I guess I was wrong about that feature (have not used ST for some time now due to finding Brackets). Still could be nice to have, though.

I don't believe #8243 covers what I was saying about the ALT+F3 keybind, it seems to relate more to ALT+F4 being too close to it, not that the wrong code is highlighted. I can repost the issue I discovered there (or in another issue) if you wish, though.


peterflynn commented Aug 5, 2014

@Mark-Simulacrum Oops, sorry -- I misread the issue there. It looks like Sublime behaves the same way though, unless you've checked off the "Whole word" option while doing a regular Find operation previously. Brackets doesn't have that option yet, but it might soon -- see #8310. I'll make sure "Find All and Select" respects that flag as well once it's added.

I've added your highlightMatches suggestion to our feature backlog here: Highlight occurrences of word at cursor (without needing to select). Please upvote it to help raise its priority.

Closing again since it sounds like the "Whole word" patch and the backlog item cover everything now.

peterflynn closed this Aug 5, 2014


TomMalbran commented Aug 5, 2014

@peterflynn @Mark-Simulacrum Using the preferences "highlightMatches": { "showToken": true } makes the Brackets highlight the matches without selecting. But since "highlightMatches" can work both as a boolean or as an object preference, maybe we could add a new preference to achieve the same result.

kuige commented Aug 10, 2014

I really sorry that I have forgotten to review this issue...The Alt+F3 shortcut works fine for me,@JeffryBooher,but it's kind of cumbersome

kuige commented Aug 10, 2014

@redmunds Sorry that I forgot to reply...Well,this works fine for me,but it's still not so clear,the best is when i hover or click within a variable(without select),all the same variables are highlighted(the underline is not so attractive)


redmunds commented Aug 11, 2014

@kuige Thanks for the feedback. This is being tracked in our feature backlog here: Highlight occurrences of word at cursor (without needing to select). Please upvote it to help raise its priority. (Note you need to login to vote).


peterflynn commented Aug 14, 2014

@TomMalbran Good catch! I never knew that was possible. I've updated the preferences docs to explain that values other than simply true are available...


TomMalbran commented Aug 14, 2014

@peterflynn I knew it from the beginning, I just didn't knew that people would want it. It kind of works because of how we get the value from the preference and use it as the value for the options without changing it. You can even add a minChars option to the object (it defaults to 2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment