Skip to content

Commit 2b6ae13

Browse files
committed
Explicit frame size in test
1 parent 7ca798d commit 2b6ae13

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Sources/CodeEditTextView/Controller/TextViewController+HighlightBracket.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ extension TextViewController {
5555
}
5656
}
5757

58+
59+
/// # Dev Note
60+
/// It's interesting to note that this problem could trivially be turned into a monoid, and the locations of each
61+
/// pair start/end location determined when the view is loaded. It could then be parallelized for initial speed
62+
/// and this lookup would be much faster.
63+
5864
/// Finds a closing character given a pair of characters, ignores pairs inside the given pair.
5965
///
6066
/// ```pseudocode
@@ -63,6 +69,7 @@ extension TextViewController {
6369
/// } -- A naive algorithm may find this character as the closing pair, which would be incorrect.
6470
/// } -- Found
6571
/// ```
72+
///
6673
/// - Parameters:
6774
/// - open: The opening pair to look for.
6875
/// - close: The closing pair to look for.

Tests/CodeEditTextViewTests/TextViewControllerTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ final class TextViewControllerTests: XCTestCase {
234234
// MARK: Bracket Highlights
235235

236236
func test_bracketHighlights() {
237+
controller.scrollView.setFrameSize(NSSize(width: 500, height: 500))
237238
controller.viewDidLoad()
238239
controller.bracketPairHighlight = nil
239240
controller.textView.string = "{ Loren Ipsum {} }"

0 commit comments

Comments
 (0)