(cmd: (view: { state: unknown; dispatch: unknown }) => boolean)
| 854 | // note. We map vim's `zc` / `zo` / `zM` / `zR` keys explicitly so the |
| 855 | // advertised fold chords work regardless of what CM-Vim ships by default. |
| 856 | const runFold = (cmd: (view: { state: unknown; dispatch: unknown }) => boolean): void => { |
| 857 | const view = useStore.getState().editorViewRef |
| 858 | if (!view) return |
| 859 | cmd(view as unknown as Parameters<typeof foldCode>[0]) |
| 860 | view.focus() |
| 861 | } |
| 862 | Vim.defineAction('foldHeadingAtCursor', () => runFold(foldCode as never)) |
| 863 | Vim.defineAction('unfoldHeadingAtCursor', () => runFold(unfoldCode as never)) |
| 864 | Vim.defineAction('foldAllHeadings', () => runFold(foldAll as never)) |
no outgoing calls
no test coverage detected