Closed instabug[bot] closed 2 years ago
I suspect this might be related to the buffer being resized or maybe rotated?
I scratched my head for a while, until I realized: the selection could be beyond the boundaries of the new size. So the selection had to be invalidated, before the stack recomputes the attributed strings. The attributed strings were created, and then altered based on the selection settings to highlight - but if the selection was using the old values, when the new strings were smaller, it crashed.
In retrospect, I should have seen this
Title: NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds (TerminalView.updateSelectionAttributesIfNeeded(attributedLine:row:cols:) (AppleTerminalView.swift:458))
Number: 3
Type: Crash
Status: New
Reported At: 2022-04-06 22:14:42 UTC
Email:
Private URL: https://dashboard.instabug.com/applications/swiftterm/beta/crashes/3?utm_source=github&utm_medium=integrations
App Version: 1.0 (135)
Current View: _TtGC7SwiftUI19UIHostingControllerGVS_15ModifiedContentVVS_22_VariadicView_Children7ElementVS_24Navi
Device: iPhone 13 Pro
Duration: 280
User Steps: