Skip to content

Commit

Permalink
Add an initial implementation of an indentOnInput extension
Browse files Browse the repository at this point in the history
Issue #264

FEATURE: The view package now exports an `indentOnInput` extension that enables
automatic reindentation when certain patterns are typed at the start of a line. The
basic setup enables this.
  • Loading branch information
marijnh committed Aug 10, 2020
1 parent da92640 commit 8396a85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/basic-setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {keymap, highlightSpecialChars, multipleSelections} from "@codemirror/next/view"
import {keymap, highlightSpecialChars, multipleSelections, indentOnInput} from "@codemirror/next/view"
import {Extension} from "@codemirror/next/state"
import {history, historyKeymap} from "@codemirror/next/history"
import {foldGutter, foldKeymap} from "@codemirror/next/fold"
Expand Down Expand Up @@ -28,6 +28,7 @@ import {lintKeymap} from "@codemirror/next/lint"
/// - [the undo history](#history.history)
/// - [a fold gutter](#fold.foldGutter)
/// - [multiple selection support](#view.multipleSelections)
/// - [reindentation on input](#view.indentOnInput)
/// - [the default highlighter](#highlight.defaultHighlighter)
/// - [bracket matching](#matchbrackets.bracketMatching)
/// - [bracket closing](#closebrackets.closeBrackets)
Expand All @@ -54,6 +55,7 @@ export const basicSetup: Extension = [
history(),
foldGutter(),
multipleSelections(),
indentOnInput(),
defaultHighlighter,
bracketMatching(),
closeBrackets(),
Expand Down

0 comments on commit 8396a85

Please sign in to comment.