Files
overleaf-cep/services/web/frontend/js/features/source-editor/extensions/folding-keymap.ts
Alf Eaton d203a62834 Fix (un)fold all shortcuts on macOS (#33630)
GitOrigin-RevId: db0911cdfdeb19c90bd601e6173973d884859b09
2026-05-14 08:06:00 +00:00

22 lines
433 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { foldAll, toggleFold, unfoldAll } from '@codemirror/language'
/**
* A custom extension that binds keyboard shortcuts to folding actions.
*/
export const foldingKeymap = [
{
key: 'F2',
run: toggleFold,
},
{
key: 'Alt-Shift-1',
mac: 'Alt-Shift-', // Opt-Shift-1 on macOS
run: foldAll,
},
{
key: 'Alt-Shift-0',
mac: 'Alt-Shift-', // Opt-Shift-0 on macOS
run: unfoldAll,
},
]