hide split cell button on input collapse

This commit is contained in:
rebornix 2021-08-10 11:52:47 -07:00
parent 6533d46465
commit 10c190f4d3

View file

@ -11,7 +11,7 @@ import { InputFocusedContext } from 'vs/platform/contextkey/common/contextkeys';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { Range } from 'vs/editor/common/core/range';
import { CellOverflowToolbarGroups, CellToolbarOrder, CELL_TITLE_CELL_GROUP_ID, INotebookCellActionContext, NotebookCellAction } from 'vs/workbench/contrib/notebook/browser/contrib/coreActions';
import { CellEditState, CellFocusMode, expandCellRangesWithHiddenCells, ICellViewModel, NOTEBOOK_CELL_EDITABLE, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
import { CellEditState, CellFocusMode, expandCellRangesWithHiddenCells, ICellViewModel, NOTEBOOK_CELL_EDITABLE, NOTEBOOK_CELL_INPUT_COLLAPSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
import * as icons from 'vs/workbench/contrib/notebook/browser/notebookIcons';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { CellEditType, CellKind, SelectionStateType } from 'vs/workbench/contrib/notebook/common/notebookCommon';
@ -294,7 +294,12 @@ registerAction2(class extends NotebookCellAction {
title: localize('notebookActions.splitCell', "Split Cell"),
menu: {
id: MenuId.NotebookCellTitle,
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE),
when: ContextKeyExpr.and(
NOTEBOOK_EDITOR_FOCUSED,
NOTEBOOK_EDITOR_EDITABLE,
NOTEBOOK_CELL_EDITABLE,
NOTEBOOK_CELL_INPUT_COLLAPSED.toNegated()
),
order: CellToolbarOrder.SplitCell,
group: CELL_TITLE_CELL_GROUP_ID
},