@@ -35,7 +35,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
3535import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' ;
3636import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
3737import { INotificationService } from 'vs/platform/notification/common/notification' ;
38- import { BOTTOM_CELL_TOOLBAR_GAP , CELL_BOTTOM_MARGIN , CELL_TOP_MARGIN , EDITOR_BOTTOM_PADDING , EDITOR_TOOLBAR_HEIGHT , EDITOR_TOP_PADDING } from 'vs/workbench/contrib/notebook/browser/constants' ;
38+ import { BOTTOM_CELL_TOOLBAR_GAP , CELL_BOTTOM_MARGIN , CELL_TOP_MARGIN , EDITOR_BOTTOM_PADDING , EDITOR_BOTTOM_PADDING_WITHOUT_STATUSBAR , EDITOR_TOOLBAR_HEIGHT , EDITOR_TOP_PADDING } from 'vs/workbench/contrib/notebook/browser/constants' ;
3939import { CancelCellAction , DeleteCellAction , ExecuteCellAction , INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/contrib/coreActions' ;
4040import { BaseCellRenderTemplate , CellEditState , CodeCellRenderTemplate , EXPAND_CELL_CONTENT_COMMAND_ID , ICellViewModel , INotebookEditor , isCodeCellRenderTemplate , MarkdownCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
4141import { CellContextKeyManager } from 'vs/workbench/contrib/notebook/browser/view/renderers/cellContextKeys' ;
@@ -45,7 +45,7 @@ import { StatefulMarkdownCell } from 'vs/workbench/contrib/notebook/browser/view
4545import { CodeCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel' ;
4646import { MarkdownCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel' ;
4747import { CellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel' ;
48- import { CellKind , NotebookCellMetadata , NotebookCellRunState } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
48+ import { CellKind , NotebookCellMetadata , NotebookCellRunState , ShowCellStatusbarKey } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
4949import { createAndFillInActionBarActionsWithVerticalSeparators , VerticalSeparator , VerticalSeparatorViewItem } from './cellActionView' ;
5050import { CodiconActionViewItem , CellLanguageStatusBarItem } from 'vs/workbench/contrib/notebook/browser/view/renderers/commonViewComponents' ;
5151import { CellDragAndDropController , DRAGGING_CLASS } from 'vs/workbench/contrib/notebook/browser/view/renderers/dnd' ;
@@ -82,10 +82,6 @@ export class NotebookCellListDelegate implements IListVirtualDelegate<CellViewMo
8282export class CellEditorOptions {
8383
8484 private static fixedEditorOptions : IEditorOptions = {
85- padding : {
86- top : EDITOR_TOP_PADDING ,
87- bottom : EDITOR_BOTTOM_PADDING
88- } ,
8985 scrollBeyondLastLine : false ,
9086 scrollbar : {
9187 verticalScrollbarSize : 14 ,
@@ -115,17 +111,24 @@ export class CellEditorOptions {
115111 constructor ( configurationService : IConfigurationService , language : string ) {
116112
117113 this . disposable = configurationService . onDidChangeConfiguration ( e => {
118- if ( e . affectsConfiguration ( 'editor' ) ) {
114+ if ( e . affectsConfiguration ( 'editor' ) || e . affectsConfiguration ( ShowCellStatusbarKey ) ) {
119115 this . _value = computeEditorOptions ( ) ;
120116 this . _onDidChange . fire ( this . value ) ;
121117 }
122118 } ) ;
123119
124120 const computeEditorOptions = ( ) => {
121+ const showCellStatusBar = configurationService . getValue < boolean > ( ShowCellStatusbarKey ) ;
122+ const editorPadding = {
123+ top : EDITOR_TOP_PADDING ,
124+ bottom : showCellStatusBar ? EDITOR_BOTTOM_PADDING : EDITOR_BOTTOM_PADDING_WITHOUT_STATUSBAR
125+ } ;
126+
125127 const editorOptions = deepClone ( configurationService . getValue < IEditorOptions > ( 'editor' , { overrideIdentifier : language } ) ) ;
126128 const computed = {
127129 ...editorOptions ,
128- ...CellEditorOptions . fixedEditorOptions
130+ ...CellEditorOptions . fixedEditorOptions ,
131+ ...{ padding : editorPadding }
129132 } ;
130133
131134 if ( ! computed . folding ) {
@@ -660,10 +663,10 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
660663 const dragHandle = DOM . append ( container , DOM . $ ( '.cell-drag-handle' ) ) ;
661664
662665 const cellContainer = DOM . append ( container , $ ( '.cell.code' ) ) ;
663- const runButtonContainer = DOM . append ( cellContainer , $ ( '.run-button-container' ) ) ;
664- const runToolbar = disposables . add ( this . createToolbar ( runButtonContainer ) ) ;
665666
666- const executionOrderLabel = DOM . append ( cellContainer , $ ( 'div.execution-count-label' ) ) ;
667+ const runButtonContainer = DOM . append ( container , $ ( '.run-button-container' ) ) ;
668+ const runToolbar = disposables . add ( this . createToolbar ( runButtonContainer ) ) ;
669+ const executionOrderLabel = DOM . append ( runButtonContainer , $ ( 'div.execution-count-label' ) ) ;
667670
668671 // create a special context key service that set the inCompositeEditor-contextkey
669672 const editorContextKeyService = disposables . add ( this . contextKeyServiceProvider ( container ) ) ;
@@ -761,7 +764,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
761764
762765 private updateForMetadata ( element : CodeCellViewModel , templateData : CodeCellRenderTemplate ) : void {
763766 const metadata = element . getEvaluatedMetadata ( this . notebookEditor . viewModel ! . notebookDocument . metadata ) ;
764- DOM . toggleClass ( templateData . cellContainer , 'runnable' , ! ! metadata . runnable ) ;
767+ DOM . toggleClass ( templateData . container , 'runnable' , ! ! metadata . runnable ) ;
765768 this . updateExecutionOrder ( metadata , templateData ) ;
766769 templateData . cellStatusMessageContainer . textContent = metadata ?. statusMessage || '' ;
767770
0 commit comments