@@ -18,7 +18,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
18
18
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
19
19
import { IQuickInputService , IQuickPickItem , QuickPickInput } from 'vs/platform/quickinput/common/quickInput' ;
20
20
import { changeCellToKind , runDeleteAction } from 'vs/workbench/contrib/notebook/browser/controller/cellOperations' ;
21
- import { CellToolbarOrder , CELL_TITLE_CELL_GROUP_ID , CELL_TITLE_OUTPUT_GROUP_ID , executeNotebookCondition , INotebookActionContext , INotebookCellActionContext , NotebookAction , NotebookCellAction , NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT } from 'vs/workbench/contrib/notebook/browser/controller/coreActions' ;
21
+ import { CellToolbarOrder , CELL_TITLE_CELL_GROUP_ID , CELL_TITLE_OUTPUT_GROUP_ID , executeNotebookCondition , INotebookActionContext , INotebookCellActionContext , NotebookAction , NotebookCellAction , NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT , findTargetCellEditor } from 'vs/workbench/contrib/notebook/browser/controller/coreActions' ;
22
22
import { NOTEBOOK_CELL_EDITABLE , NOTEBOOK_CELL_HAS_OUTPUTS , NOTEBOOK_CELL_LIST_FOCUSED , NOTEBOOK_CELL_MARKDOWN_EDIT_MODE , NOTEBOOK_CELL_TYPE , NOTEBOOK_EDITOR_EDITABLE , NOTEBOOK_EDITOR_FOCUSED , NOTEBOOK_HAS_OUTPUTS , NOTEBOOK_IS_ACTIVE_EDITOR , NOTEBOOK_OUTPUT_FOCUSED , NOTEBOOK_USE_CONSOLIDATED_OUTPUT_BUTTON } from 'vs/workbench/contrib/notebook/common/notebookContextKeys' ;
23
23
import { CellEditState , CHANGE_CELL_LANGUAGE , DETECT_CELL_LANGUAGE , QUIT_EDIT_CELL_COMMAND_ID } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
24
24
import * as icons from 'vs/workbench/contrib/notebook/browser/notebookIcons' ;
@@ -30,6 +30,8 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
30
30
import { INotebookKernelService } from 'vs/workbench/contrib/notebook/common/notebookKernelService' ;
31
31
import { IDialogService , IConfirmationResult } from 'vs/platform/dialogs/common/dialogs' ;
32
32
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
33
+ import { ICodeEditor } from 'vs/editor/browser/editorBrowser' ;
34
+ import { InteractiveEditorController } from 'vs/workbench/contrib/interactiveEditor/browser/interactiveEditorController' ;
33
35
34
36
35
37
const CLEAR_ALL_CELLS_OUTPUTS_COMMAND_ID = 'notebook.clearAllCellsOutputs' ;
@@ -71,6 +73,10 @@ registerAction2(class EditCellAction extends NotebookCellAction {
71
73
}
72
74
73
75
await context . notebookEditor . focusNotebookCell ( context . cell , 'editor' ) ;
76
+ const foundEditor : ICodeEditor | undefined = context . cell ? findTargetCellEditor ( context , context . cell ) : undefined ;
77
+ if ( foundEditor && foundEditor . hasTextFocus ( ) && InteractiveEditorController . get ( foundEditor ) ?. getWidgetPosition ( ) ?. lineNumber === foundEditor . getPosition ( ) ?. lineNumber ) {
78
+ InteractiveEditorController . get ( foundEditor ) ?. focus ( ) ;
79
+ }
74
80
}
75
81
} ) ;
76
82
0 commit comments