@@ -253,8 +253,8 @@ class DirtyDiffWidget extends PeekViewWidget {
253
253
protected override _fillHead ( container : HTMLElement ) : void {
254
254
super . _fillHead ( container , true ) ;
255
255
256
- const previous = this . instantiationService . createInstance ( UIEditorAction , this . editor , new ShowPreviousChangeAction ( ) , ThemeIcon . asClassName ( gotoPreviousLocation ) ) ;
257
- const next = this . instantiationService . createInstance ( UIEditorAction , this . editor , new ShowNextChangeAction ( ) , ThemeIcon . asClassName ( gotoNextLocation ) ) ;
256
+ const previous = this . instantiationService . createInstance ( UIEditorAction , this . editor , new ShowPreviousChangeAction ( this . editor ) , ThemeIcon . asClassName ( gotoPreviousLocation ) ) ;
257
+ const next = this . instantiationService . createInstance ( UIEditorAction , this . editor , new ShowNextChangeAction ( this . editor ) , ThemeIcon . asClassName ( gotoNextLocation ) ) ;
258
258
259
259
this . _disposables . add ( previous ) ;
260
260
this . _disposables . add ( next ) ;
@@ -363,7 +363,7 @@ class DirtyDiffWidget extends PeekViewWidget {
363
363
364
364
export class ShowPreviousChangeAction extends EditorAction {
365
365
366
- constructor ( ) {
366
+ constructor ( private readonly outerEditor ?: ICodeEditor ) {
367
367
super ( {
368
368
id : 'editor.action.dirtydiff.previous' ,
369
369
label : nls . localize ( 'show previous change' , "Show Previous Change" ) ,
@@ -373,8 +373,8 @@ export class ShowPreviousChangeAction extends EditorAction {
373
373
} ) ;
374
374
}
375
375
376
- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
377
- const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
376
+ run ( accessor : ServicesAccessor ) : void {
377
+ const outerEditor = this . outerEditor ?? getOuterEditorFromDiffEditor ( accessor ) ;
378
378
379
379
if ( ! outerEditor ) {
380
380
return ;
@@ -397,7 +397,7 @@ registerEditorAction(ShowPreviousChangeAction);
397
397
398
398
export class ShowNextChangeAction extends EditorAction {
399
399
400
- constructor ( ) {
400
+ constructor ( private readonly outerEditor ?: ICodeEditor ) {
401
401
super ( {
402
402
id : 'editor.action.dirtydiff.next' ,
403
403
label : nls . localize ( 'show next change' , "Show Next Change" ) ,
@@ -407,8 +407,8 @@ export class ShowNextChangeAction extends EditorAction {
407
407
} ) ;
408
408
}
409
409
410
- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
411
- const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
410
+ run ( accessor : ServicesAccessor ) : void {
411
+ const outerEditor = this . outerEditor ?? getOuterEditorFromDiffEditor ( accessor ) ;
412
412
413
413
if ( ! outerEditor ) {
414
414
return ;
@@ -460,7 +460,7 @@ export class GotoPreviousChangeAction extends EditorAction {
460
460
} ) ;
461
461
}
462
462
463
- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
463
+ run ( accessor : ServicesAccessor ) : void {
464
464
const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
465
465
466
466
if ( ! outerEditor || ! outerEditor . hasModel ( ) ) {
@@ -502,7 +502,7 @@ export class GotoNextChangeAction extends EditorAction {
502
502
} ) ;
503
503
}
504
504
505
- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
505
+ run ( accessor : ServicesAccessor ) : void {
506
506
const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
507
507
508
508
if ( ! outerEditor || ! outerEditor . hasModel ( ) ) {
0 commit comments