@@ -253,8 +253,8 @@ class DirtyDiffWidget extends PeekViewWidget {
253253 protected override _fillHead ( container : HTMLElement ) : void {
254254 super . _fillHead ( container , true ) ;
255255
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 ) ) ;
258258
259259 this . _disposables . add ( previous ) ;
260260 this . _disposables . add ( next ) ;
@@ -363,7 +363,7 @@ class DirtyDiffWidget extends PeekViewWidget {
363363
364364export class ShowPreviousChangeAction extends EditorAction {
365365
366- constructor ( ) {
366+ constructor ( private readonly outerEditor ?: ICodeEditor ) {
367367 super ( {
368368 id : 'editor.action.dirtydiff.previous' ,
369369 label : nls . localize ( 'show previous change' , "Show Previous Change" ) ,
@@ -373,8 +373,8 @@ export class ShowPreviousChangeAction extends EditorAction {
373373 } ) ;
374374 }
375375
376- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
377- const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
376+ run ( accessor : ServicesAccessor ) : void {
377+ const outerEditor = this . outerEditor ?? getOuterEditorFromDiffEditor ( accessor ) ;
378378
379379 if ( ! outerEditor ) {
380380 return ;
@@ -397,7 +397,7 @@ registerEditorAction(ShowPreviousChangeAction);
397397
398398export class ShowNextChangeAction extends EditorAction {
399399
400- constructor ( ) {
400+ constructor ( private readonly outerEditor ?: ICodeEditor ) {
401401 super ( {
402402 id : 'editor.action.dirtydiff.next' ,
403403 label : nls . localize ( 'show next change' , "Show Next Change" ) ,
@@ -407,8 +407,8 @@ export class ShowNextChangeAction extends EditorAction {
407407 } ) ;
408408 }
409409
410- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
411- const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
410+ run ( accessor : ServicesAccessor ) : void {
411+ const outerEditor = this . outerEditor ?? getOuterEditorFromDiffEditor ( accessor ) ;
412412
413413 if ( ! outerEditor ) {
414414 return ;
@@ -460,7 +460,7 @@ export class GotoPreviousChangeAction extends EditorAction {
460460 } ) ;
461461 }
462462
463- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
463+ run ( accessor : ServicesAccessor ) : void {
464464 const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
465465
466466 if ( ! outerEditor || ! outerEditor . hasModel ( ) ) {
@@ -502,7 +502,7 @@ export class GotoNextChangeAction extends EditorAction {
502502 } ) ;
503503 }
504504
505- run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
505+ run ( accessor : ServicesAccessor ) : void {
506506 const outerEditor = getOuterEditorFromDiffEditor ( accessor ) ;
507507
508508 if ( ! outerEditor || ! outerEditor . hasModel ( ) ) {
0 commit comments