Skip to content

Commit d2c2e28

Browse files
committed
feat: add code folding
Closes #71
1 parent 34f6769 commit d2c2e28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/components/Output/OutputEditor.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { Button } from '@carbon/react';
44
import { Copy } from '@carbon/icons-react';
55

66
import { EditorState } from '@codemirror/state';
7-
import { EditorView } from '@codemirror/view';
7+
import { EditorView, keymap } from '@codemirror/view';
88
import { json } from '@codemirror/lang-json';
9+
import { foldGutter, unfoldAll, foldKeymap } from '@codemirror/language';
910
import theme from '../shared/CodeMirrorTheme';
1011

1112

@@ -31,6 +32,8 @@ export default function OutputEditor({ value }) {
3132
EditorState.readOnly.of(true),
3233
EditorView.editable.of(false),
3334
EditorView.lineWrapping,
35+
foldGutter(),
36+
keymap.of(foldKeymap),
3437
theme,
3538
]
3639
});

0 commit comments

Comments
 (0)