mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Check index availablity in brace match with Swift.String.Index
This commit is contained in:
parent
f494572f55
commit
2cd2e25c5e
@ -14,6 +14,7 @@
|
||||
|
||||
- Fix an issue that the application could not open a document containing a specific pattern of letters.
|
||||
- Fix a possible crash when opening a corrupt file.
|
||||
- Fix a possible crash when moving the cursor in the editor.
|
||||
- Fix an issue that the validation error message in the syntax editor did not change even when errors were found.
|
||||
|
||||
|
||||
|
@ -37,8 +37,8 @@ extension NSTextView {
|
||||
|
||||
let cursorIndexes = selectedRanges
|
||||
.filter { $0.isEmpty }
|
||||
.filter { $0.location > 0 }
|
||||
.map { String.Index(utf16Offset: $0.lowerBound, in: self.string) }
|
||||
.filter { $0 > self.string.startIndex }
|
||||
|
||||
guard
|
||||
!cursorIndexes.isEmpty,
|
||||
|
Loading…
Reference in New Issue
Block a user