File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Sources/CodeEditSourceEditor/Highlighting/StyledRangeContainer Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,6 @@ class StyledRangeContainer {
123123 var minValue = allRuns. compactMap { $0. last } . enumerated ( ) . min ( by: { $0. 1 . length < $1. 1 . length } )
124124
125125 while let value = minValue {
126- // Early return if all arrays are empty
127- guard allRuns. contains ( where: { !$0. isEmpty } ) else {
128- return runs. reversed ( )
129- }
130-
131126 // Get minimum length off the end of each array
132127 let minRunIdx = value. offset
133128 var minRun = value. element
@@ -148,7 +143,9 @@ class StyledRangeContainer {
148143 }
149144 }
150145
151- allRuns [ minRunIdx] . removeLast ( )
146+ if !allRuns[ minRunIdx] . isEmpty {
147+ allRuns [ minRunIdx] . removeLast ( )
148+ }
152149
153150 runs. append ( minRun)
154151 minValue = allRuns. compactMap { $0. last } . enumerated ( ) . min ( by: { $0. 1 . length < $1. 1 . length } )
You can’t perform that action at this time.
0 commit comments