overleaf/services/web/frontend/js/features/source-editor/extensions/folding-keymap.ts
Alf Eaton e025088065 Merge pull request #13241 from overleaf/ae-extensions-documentation
Add documentation for CodeMirror extensions

GitOrigin-RevId: e5f07084173f201919272f9d46dcdaef4b817874
2023-07-17 10:28:53 +00:00

19 lines
333 B
TypeScript

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',
run: foldAll,
},
{
key: 'Alt-Shift-0',
run: unfoldAll,
},
]