mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 11:01:56 +02:00
[cm6] Hide list indentation shortcuts in button tooltips in Code Editor (#13797)
GitOrigin-RevId: d5184310d81953d9765f6e1ae2343fdeb824ae01
This commit is contained in:
@@ -46,6 +46,7 @@ const Toolbar = memo(function Toolbar() {
|
||||
const overflowedItemsRef = useRef<Set<string>>(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 (
|
||||
<div className="ol-cm-toolbar toolbar-editor" ref={resizeRef}>
|
||||
{showSourceToolbar && <EditorSwitch />}
|
||||
<ToolbarItems state={state} languageName={languageName} />
|
||||
<ToolbarItems state={state} languageName={languageName} visual={visual} />
|
||||
<div
|
||||
className="ol-cm-toolbar-button-group ol-cm-toolbar-stretch"
|
||||
ref={overflowBeforeRef}
|
||||
@@ -116,6 +117,7 @@ const Toolbar = memo(function Toolbar() {
|
||||
state={state}
|
||||
overflowed={overflowedItemsRef.current}
|
||||
languageName={languageName}
|
||||
visual={visual}
|
||||
/>
|
||||
</ToolbarOverflow>
|
||||
<div className="formatting-buttons-wrapper" />
|
||||
@@ -128,7 +130,7 @@ const Toolbar = memo(function Toolbar() {
|
||||
active={searchPanelOpen(state)}
|
||||
icon="search"
|
||||
/>
|
||||
{languageName === 'latex' && !isVisual(view) && (
|
||||
{languageName === 'latex' && !visual && (
|
||||
<SplitTestBadge
|
||||
splitTestName="source-editor-toolbar"
|
||||
displayOnVariants={['enabled']}
|
||||
|
||||
@@ -24,7 +24,8 @@ export const ToolbarItems: FC<{
|
||||
state: EditorState
|
||||
overflowed?: Set<string>
|
||||
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}
|
||||
/>
|
||||
<ToolbarButton
|
||||
@@ -200,7 +201,7 @@ export const ToolbarItems: FC<{
|
||||
label={t('toolbar_increase_indent')}
|
||||
command={commands.indentIncrease}
|
||||
icon="indent"
|
||||
shortcut={isMac ? '⌘]' : 'Ctrl+]'}
|
||||
shortcut={visual ? (isMac ? '⌘]' : 'Ctrl+]') : undefined}
|
||||
disabled={listDepth < 1}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user