@@ -139,6 +139,10 @@ export class DiffFile {
139
139
140
140
#_theme?: "light" | "dark" ;
141
141
142
+ #hasExpandSplitAll = { state : false } ;
143
+
144
+ #hasExpandUnifiedAll = { state : false } ;
145
+
142
146
_version_ = __VERSION__ ;
143
147
144
148
_oldFileName : string = "" ;
@@ -167,9 +171,9 @@ export class DiffFile {
167
171
168
172
deletionLength : number = 0 ;
169
173
170
- hasExpandSplitAll : boolean = false ;
174
+ // hasExpandSplitAll: boolean = false;
171
175
172
- hasExpandUnifiedAll : boolean = false ;
176
+ // hasExpandUnifiedAll: boolean = false;
173
177
174
178
hasSomeLineCollapsed : boolean = false ;
175
179
@@ -1194,17 +1198,25 @@ export class DiffFile {
1194
1198
Object . keys ( this . #splitHunksLines || { } ) . forEach ( ( key ) => {
1195
1199
this . onSplitHunkExpand ( "all" , + key , false ) ;
1196
1200
} ) ;
1197
- this . hasExpandSplitAll = true ;
1201
+ this . # hasExpandSplitAll. state = true ;
1198
1202
} else {
1199
1203
Object . keys ( this . #unifiedHunksLines || { } ) . forEach ( ( key ) => {
1200
1204
this . onUnifiedHunkExpand ( "all" , + key , false ) ;
1201
1205
} ) ;
1202
- this . hasExpandUnifiedAll = true ;
1206
+ this . # hasExpandUnifiedAll. state = true ;
1203
1207
}
1204
1208
1205
1209
this . notifyAll ( ) ;
1206
1210
} ;
1207
1211
1212
+ getHasExpandSplitAll ( ) {
1213
+ return this . #hasExpandSplitAll. state ;
1214
+ }
1215
+
1216
+ getHasExpandUnifiedAll ( ) {
1217
+ return this . #hasExpandUnifiedAll. state ;
1218
+ }
1219
+
1208
1220
onAllCollapse = ( mode : "split" | "unified" ) => {
1209
1221
if ( this . #composeByDiff) return ;
1210
1222
@@ -1241,7 +1253,7 @@ export class DiffFile {
1241
1253
this . #splitHunksLines! [ item . splitInfo . endHiddenIndex ] = item ;
1242
1254
}
1243
1255
} ) ;
1244
- this . hasExpandSplitAll = false ;
1256
+ this . # hasExpandSplitAll. state = false ;
1245
1257
} else {
1246
1258
Object . values ( this . #unifiedLines || { } ) . forEach ( ( item ) => {
1247
1259
if ( ! item . isHidden && item . _isHidden ) {
@@ -1270,19 +1282,19 @@ export class DiffFile {
1270
1282
this . #unifiedHunksLines! [ item . unifiedInfo . endHiddenIndex ] = item ;
1271
1283
}
1272
1284
} ) ;
1273
- this . hasExpandUnifiedAll = false ;
1285
+ this . # hasExpandUnifiedAll. state = false ;
1274
1286
}
1275
1287
1276
1288
this . notifyAll ( ) ;
1277
1289
} ;
1278
1290
1279
1291
getOldFileContent = ( ) => {
1280
1292
return this . #oldFileResult?. raw ;
1281
- }
1293
+ } ;
1282
1294
1283
1295
getNewFileContent = ( ) => {
1284
1296
return this . #newFileResult?. raw ;
1285
- }
1297
+ } ;
1286
1298
1287
1299
getOldSyntaxLine = ( lineNumber : number ) => {
1288
1300
return this . #oldFileSyntaxLines?. [ lineNumber ] ;
@@ -1343,6 +1355,8 @@ export class DiffFile {
1343
1355
const highlighterName = this . #highlighterName;
1344
1356
const highlighterType = this . #highlighterType;
1345
1357
const hasSomeLineCollapsed = this . hasSomeLineCollapsed ;
1358
+ const hasExpandSplitAll = this . #hasExpandSplitAll;
1359
+ const hasExpandUnifiedAll = this . #hasExpandUnifiedAll;
1346
1360
1347
1361
// split
1348
1362
const splitLeftLines = this . #splitLeftLines;
@@ -1384,6 +1398,8 @@ export class DiffFile {
1384
1398
highlighterType,
1385
1399
composeByDiff,
1386
1400
hasSomeLineCollapsed,
1401
+ hasExpandSplitAll,
1402
+ hasExpandUnifiedAll,
1387
1403
1388
1404
version,
1389
1405
@@ -1416,6 +1432,8 @@ export class DiffFile {
1416
1432
this . additionLength = data . additionLength ;
1417
1433
this . deletionLength = data . deletionLength ;
1418
1434
this . hasSomeLineCollapsed = data . hasSomeLineCollapsed ;
1435
+ this . #hasExpandSplitAll = data . hasExpandSplitAll ;
1436
+ this . #hasExpandUnifiedAll = data . hasExpandUnifiedAll ;
1419
1437
1420
1438
this . #splitLeftLines = data . splitLeftLines ;
1421
1439
this . #splitRightLines = data . splitRightLines ;
0 commit comments