@@ -645,7 +645,7 @@ class DisplayLayer {
645
645
let lastScreenRow = startRow
646
646
let lastBufferRow = this . translateScreenPositionWithSpatialIndex ( startPosition ) . row
647
647
const hunks = this . spatialIndex . getChangesInNewRange ( startPosition , Point ( endRow , 0 ) )
648
- for ( let i = 0 ; i < hunks . length ; i ++ ) {
648
+ for ( let i = 0 , len = hunks . length ; i < len ; i ++ ) {
649
649
const hunk = hunks [ i ]
650
650
while ( lastScreenRow <= hunk . newStart . row ) {
651
651
bufferRows . push ( lastBufferRow )
@@ -689,7 +689,7 @@ class DisplayLayer {
689
689
690
690
leadingWhitespaceLengthForNonEmptyLine ( line ) {
691
691
let length = 0
692
- for ( let i = 0 ; i < line . length ; i ++ ) {
692
+ for ( let i = 0 , len = line . length ; i < len ; i ++ ) {
693
693
const character = line [ i ]
694
694
if ( character === ' ' ) {
695
695
length ++
@@ -935,7 +935,7 @@ class DisplayLayer {
935
935
let unexpandedScreenColumnAfterLastTab = indentLength
936
936
let expandedScreenColumnAfterLastTab = indentLength
937
937
let tabCountPrecedingWrap = 0
938
- for ( let i = 0 ; i < currentScreenLineTabColumns . length ; i ++ ) {
938
+ for ( let i = 0 , len = currentScreenLineTabColumns . length ; i < len ; i ++ ) {
939
939
const tabColumn = currentScreenLineTabColumns [ i ]
940
940
if ( tabColumn < unexpandedWrapColumn ) {
941
941
tabCountPrecedingWrap ++
@@ -1140,12 +1140,13 @@ class DisplayLayer {
1140
1140
}
1141
1141
}
1142
1142
1143
- for ( let i = 0 ; i < foldMarkers . length ; i ++ ) {
1143
+ const foldMarkersLength = foldMarkers . length
1144
+ for ( let i = 0 ; i < foldMarkersLength ; i ++ ) {
1144
1145
const foldStart = foldMarkers [ i ] . getStartPosition ( )
1145
1146
let foldEnd = foldMarkers [ i ] . getEndPosition ( )
1146
1147
1147
1148
// Merge overlapping folds
1148
- while ( i < foldMarkers . length - 1 ) {
1149
+ while ( i < foldMarkersLength - 1 ) {
1149
1150
const nextFoldMarker = foldMarkers [ i + 1 ]
1150
1151
if ( compare ( nextFoldMarker . getStartPosition ( ) , foldEnd ) < 0 ) {
1151
1152
if ( compare ( foldEnd , nextFoldMarker . getEndPosition ( ) ) < 0 ) {
0 commit comments