From 5a786029a326e5367f5c61823764bd7e103853c2 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 11 Jul 2023 14:30:55 +0100 Subject: [PATCH] [cm6] Hide list indentation shortcuts in button tooltips in Code Editor (#13797) GitOrigin-RevId: d5184310d81953d9765f6e1ae2343fdeb824ae01 --- .../source-editor/components/codemirror-toolbar.tsx | 6 ++++-- .../source-editor/components/toolbar/toolbar-items.tsx | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx b/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx index 3203687d07..b6090141f2 100644 --- a/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx +++ b/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx @@ -46,6 +46,7 @@ const Toolbar = memo(function Toolbar() { const overflowedItemsRef = useRef>(new Set()) const languageName = state.facet(language)?.name + const visual = isVisual(view) const { open: overflowOpen, @@ -100,7 +101,7 @@ const Toolbar = memo(function Toolbar() { return (
{showSourceToolbar && } - +
@@ -128,7 +130,7 @@ const Toolbar = memo(function Toolbar() { active={searchPanelOpen(state)} icon="search" /> - {languageName === 'latex' && !isVisual(view) && ( + {languageName === 'latex' && !visual && ( languageName?: string -}> = memo(function ToolbarItems({ state, overflowed, languageName }) { + visual: boolean +}> = memo(function ToolbarItems({ state, overflowed, languageName, visual }) { const { t } = useTranslation() const { toggleSymbolPalette, showSymbolPalette } = useEditorContext() const isActive = withinFormattingCommand(state) @@ -192,7 +193,7 @@ export const ToolbarItems: FC<{ label={t('toolbar_decrease_indent')} command={commands.indentDecrease} icon="outdent" - shortcut={isMac ? '⌘[' : 'Ctrl+['} + shortcut={visual ? (isMac ? '⌘[' : 'Ctrl+[') : undefined} disabled={listDepth < 2} />