66import * as DOM from 'vs/base/browser/dom' ;
77import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent' ;
88import { IListRenderer , IListVirtualDelegate , ListError } from 'vs/base/browser/ui/list/list' ;
9- import { IListStyles , IStyleController } from 'vs/base/browser/ui/list/listWidget' ;
9+ import { IListStyles , IStyleController , MouseController } from 'vs/base/browser/ui/list/listWidget' ;
1010import { Emitter , Event } from 'vs/base/common/event' ;
1111import { DisposableStore , IDisposable } from 'vs/base/common/lifecycle' ;
1212import { isMacintosh } from 'vs/base/common/platform' ;
@@ -19,9 +19,9 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
1919import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
2020import { IListService , IWorkbenchListOptions , WorkbenchList } from 'vs/platform/list/browser/listService' ;
2121import { IThemeService } from 'vs/platform/theme/common/themeService' ;
22- import { CellRevealPosition , CellRevealType , CursorAtBoundary , getVisibleCells , ICellRange , ICellViewModel , INotebookCellList , reduceCellRanges } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
22+ import { CellRevealPosition , CellRevealType , CursorAtBoundary , getVisibleCells , ICellRange , ICellViewModel , INotebookCellList , reduceCellRanges , CellEditState } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
2323import { CellViewModel , NotebookViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel' ;
24- import { diff , IOutput , NOTEBOOK_EDITOR_CURSOR_BOUNDARY } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
24+ import { diff , IOutput , NOTEBOOK_EDITOR_CURSOR_BOUNDARY , CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
2525
2626export class NotebookCellList extends WorkbenchList < CellViewModel > implements IDisposable , IStyleController , INotebookCellList {
2727 get onWillScroll ( ) : Event < ScrollEvent > { return this . view . onWillScroll ; }
@@ -120,6 +120,10 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
120120
121121 }
122122
123+ protected createMouseController ( ) : MouseController < CellViewModel > {
124+ return new NotebookMouseController ( this ) ;
125+ }
126+
123127 detachViewModel ( ) {
124128 this . _viewModelStore . clear ( ) ;
125129 this . _viewModel = null ;
@@ -761,3 +765,13 @@ function getEditorAttachedPromise(element: CellViewModel) {
761765function isContextMenuFocused ( ) {
762766 return ! ! DOM . findParentWithClass ( < HTMLElement > document . activeElement , 'context-view' ) ;
763767}
768+
769+
770+ class NotebookMouseController extends MouseController < CellViewModel > {
771+ protected onDoubleClick ( ) : void {
772+ const focus = this . list . getFocusedElements ( ) [ 0 ] ;
773+ if ( focus && focus . cellKind === CellKind . Markdown ) {
774+ focus . editState = CellEditState . Editing ;
775+ }
776+ }
777+ }
0 commit comments