This repository was archived by the owner on Dec 30, 2025. It is now read-only.
Add matching bracket highlighting in the editor#271
Open
mhavard999 wants to merge 2 commits into4clojure:developfrom
Open
Add matching bracket highlighting in the editor#271mhavard999 wants to merge 2 commits into4clojure:developfrom
mhavard999 wants to merge 2 commits into4clojure:developfrom
Conversation
Member
|
Where did this |
Member
|
Provided the provenance of matchbrackets.js is okay, I'd also like the highlight re-styled: as they are now, I can't see the cursor anymore when a bracket is highlighted, so I can't tell whether i'm before it or after it, or even which of the two matching brackets the cursor is on. Perhaps something more like Eclipse does, a thin red outline around only one of the brackets (the one your cursor isn't currently on)? |
Author
|
or here's the direct link: http://codemirror.net/addon/edit/matchbrackets.js I'll get that style change in there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #270, this adds matching bracket highlighting functionality to the editor. When the cursor is next to a parenthesis, square bracket or curly bracket, it bolds the character and its corresponding closing/opening character and highlights them with a light gray color if there is a match. If there is no match, the character gets a light red color.
This was very simple as Code Mirror has an add-on for bracket matching, so it was just a matter of dropping the js file in and adding a few one-liners here and there. The new js file is not minified, but let me know if it needs to be.
The reason I modified the colors in codemirror.css is that by default it turns the matching parens a light green color that is barely visible in every theme.