Skip to content

Commit 704b76d

Browse files
(fix: #215) Update Matched Pairs (#231)
1 parent 00bb66f commit 704b76d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Sources/CodeEditSourceEditor/Controller/TextViewController+HighlightBracket.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extension TextViewController {
1818
let precedingCharacter = textView.textStorage.substring(
1919
from: NSRange(location: range.location - 1, length: 1) // The preceding character exists
2020
) {
21-
for pair in BracketPairs.allValues {
21+
for pair in BracketPairs.highlightValues {
2222
if precedingCharacter == pair.0 {
2323
// Walk forwards
2424
if let characterIndex = findClosingPair(

Sources/CodeEditSourceEditor/Controller/TextViewController+TextFormation.swift

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ extension TextViewController {
1717
("{", "}"),
1818
("[", "]"),
1919
("(", ")"),
20-
("<", ">")
20+
("\"", "\""),
21+
("'", "'")
22+
]
23+
24+
static let highlightValues: [(String, String)] = [
25+
("{", "}"),
26+
("[", "]"),
27+
("(", ")")
2128
]
2229
}
2330

0 commit comments

Comments
 (0)