Skip to content

Commit 2e6d20a

Browse files
rcosta358codex
andcommitted
Keep Tab and Shift-Tab indentation inside the editor
Co-authored-by: Codex <codex@openai.com>
1 parent 7c6f046 commit 2e6d20a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎scripts/playground/editor-setup.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { EditorState } from '@codemirror/state';
22
import { lineNumbers, highlightActiveLineGutter, highlightSpecialChars, drawSelection, dropCursor, rectangularSelection, crosshairCursor, highlightActiveLine, keymap } from '@codemirror/view';
33
import { indentOnInput, bracketMatching } from '@codemirror/language';
4-
import { history, defaultKeymap, historyKeymap } from '@codemirror/commands';
4+
import { history, defaultKeymap, historyKeymap, insertTab, indentLess } from '@codemirror/commands';
55
import { searchKeymap } from '@codemirror/search';
66
import { closeBrackets, autocompletion, closeBracketsKeymap, completionKeymap } from '@codemirror/autocomplete';
77
import { linter, lintKeymap } from '@codemirror/lint';
@@ -24,6 +24,7 @@ export const editorSetup = [
2424
linter(null, { tooltipFilter: () => [] }),
2525
keymap.of([
2626
...closeBracketsKeymap,
27+
{ key: 'Tab', run: insertTab, shift: indentLess },
2728
...defaultKeymap,
2829
...searchKeymap,
2930
...historyKeymap,

0 commit comments

Comments
 (0)