@@ -26,6 +26,7 @@ interface TokenCache {
2626interface ExpandCache {
2727 hunkIndex : number | undefined ;
2828 direction : ExpansionDirections ;
29+ all : boolean ;
2930}
3031
3132export type LogTypes = 'click' | 'move' | 'both' | 'none' ;
@@ -77,6 +78,7 @@ interface ExpandoEventProps {
7778 type : 'line-info' ;
7879 hunkIndex : number ;
7980 direction : ExpansionDirections ;
81+ all : boolean ;
8082}
8183
8284export type GetHoveredLineResult < TMode extends InteractionManagerMode > =
@@ -517,8 +519,8 @@ export class InteractionManager<TMode extends InteractionManagerMode> {
517519 if ( isExpandoPointerTarget ( target ) && onHunkExpand != null ) {
518520 onHunkExpand (
519521 target . hunkIndex ,
520- event . shiftKey ? 'both' : target . direction ,
521- event . shiftKey ? Number . POSITIVE_INFINITY : undefined
522+ target . all || event . shiftKey ? 'both' : target . direction ,
523+ target . all || event . shiftKey ? Number . POSITIVE_INFINITY : undefined
522524 ) ;
523525 break ;
524526 }
@@ -1458,7 +1460,11 @@ export class InteractionManager<TMode extends InteractionManagerMode> {
14581460 continue ;
14591461 }
14601462
1461- if ( expandInfo == null && element . hasAttribute ( 'data-expand-button' ) ) {
1463+ if (
1464+ expandInfo == null &&
1465+ ( element . hasAttribute ( 'data-expand-button' ) ||
1466+ element . hasAttribute ( 'data-unmodified-lines' ) )
1467+ ) {
14621468 expandInfo = {
14631469 hunkIndex : undefined ,
14641470 direction : ( ( ) => {
@@ -1470,6 +1476,7 @@ export class InteractionManager<TMode extends InteractionManagerMode> {
14701476 }
14711477 return 'both' ;
14721478 } ) ( ) ,
1479+ all : element . hasAttribute ( 'data-expand-all-button' ) ,
14731480 } ;
14741481 continue ;
14751482 }
@@ -1501,6 +1508,7 @@ export class InteractionManager<TMode extends InteractionManagerMode> {
15011508 type : 'line-info' ,
15021509 hunkIndex : expandInfo . hunkIndex ,
15031510 direction : expandInfo . direction ,
1511+ all : expandInfo . all ,
15041512 } as ResolvedPointerTarget < TMode > ;
15051513 }
15061514
0 commit comments