Closed thecoolwinter closed 1 year ago
@thecoolwinter can we add a 2.5 corner radius for the box highlight?
Yes that would be easy to do quick, I'll do that rq.
@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.
@austincondiff Updated to reflect that change.
Description
Implements bracket/pair highlighting as described in #67. Adds a few functions to
STTextViewController
:highlightSelectionPairs()
findClosingPair(_ close: String, _ open: String, from: Int, limit: Int, reverse: Bool) -> Int?
to determine the indices of the opening and closing pairs.highlightRange(_ range: NSTextRange, scrollToRange: Bool = false)
bracketPairHighlight
property. Also handles removing animated layers if needed (as in the case of theflash
highlight type).There are two highlight types:
BracketPairHighlight
enum.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 onCodeEditTextView
tonil
.Related Issues
Checklist
Screenshots
Box highlight:
Flash highlight:
https://user-images.githubusercontent.com/35942988/236056573-ce5f8e61-5ed5-4799-a054-0591cfc7653b.mov
Underline highlight with red color: