CodeEditApp / CodeEditSourceEditor

A code editor view written in Swift powered by tree-sitter.
https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor
MIT License
504 stars 74 forks source link

Implement Bracket Pair Highlighting #186

Closed thecoolwinter closed 1 year ago

thecoolwinter commented 1 year ago

Description

Implements bracket/pair highlighting as described in #67. Adds a few functions to STTextViewController:

There are two highlight types:

Highlighted pairs are the same set of pairs used for the pair autocomplete filter:

This feature can also be disabled by setting the bracketPairHighlight property on CodeEditTextView to nil.

Related Issues

Checklist

Screenshots

Box highlight:

Screenshot 2023-05-07 at 8 07 11 PM

Flash highlight:

https://user-images.githubusercontent.com/35942988/236056573-ce5f8e61-5ed5-4799-a054-0591cfc7653b.mov

Underline highlight with red color:

Screenshot 2023-05-08 at 2 15 27 PM
austincondiff commented 1 year ago

@thecoolwinter can we add a 2.5 corner radius for the box highlight?

thecoolwinter commented 1 year ago

Yes that would be easy to do quick, I'll do that rq.

austincondiff commented 1 year ago

@thecoolwinter Regarding the underline variant. I think I would attach the underline to the bottom of the character instead of the bottom of the line. If the user has a large line height value this underline could be farther away from the character than desired.

thecoolwinter commented 1 year ago

@austincondiff Updated to reflect that change.