|
@@ -18,7 +18,11 @@ import { lineNumbers, highlightActiveLineGutter } from "@codemirror/gutter"
|
|
import { defaultKeymap } from "@codemirror/commands"
|
|
import { defaultKeymap } from "@codemirror/commands"
|
|
import { bracketMatching } from "@codemirror/matchbrackets"
|
|
import { bracketMatching } from "@codemirror/matchbrackets"
|
|
import { closeBrackets, closeBracketsKeymap } from "@codemirror/closebrackets"
|
|
import { closeBrackets, closeBracketsKeymap } from "@codemirror/closebrackets"
|
|
-import { searchKeymap, highlightSelectionMatches } from "@codemirror/search"
|
|
|
|
|
|
+import {
|
|
|
|
+ searchKeymap,
|
|
|
|
+ highlightSelectionMatches,
|
|
|
|
+ searchConfig,
|
|
|
|
+} from "@codemirror/search"
|
|
import { autocompletion, completionKeymap } from "@codemirror/autocomplete"
|
|
import { autocompletion, completionKeymap } from "@codemirror/autocomplete"
|
|
import { commentKeymap } from "@codemirror/comment"
|
|
import { commentKeymap } from "@codemirror/comment"
|
|
import { rectangularSelection } from "@codemirror/rectangular-selection"
|
|
import { rectangularSelection } from "@codemirror/rectangular-selection"
|
|
@@ -207,17 +211,15 @@ export const baseHighlightStyle = HighlightStyle.define([
|
|
{ tag: t.invalid, color: editorInvalidColor },
|
|
{ tag: t.invalid, color: editorInvalidColor },
|
|
])
|
|
])
|
|
|
|
|
|
-const baseFoldStyle = foldGutter({
|
|
|
|
- openText: "▾",
|
|
|
|
- closedText: "▸",
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
export const basicSetup: Extension = [
|
|
export const basicSetup: Extension = [
|
|
lineNumbers(),
|
|
lineNumbers(),
|
|
highlightActiveLineGutter(),
|
|
highlightActiveLineGutter(),
|
|
highlightSpecialChars(),
|
|
highlightSpecialChars(),
|
|
history(),
|
|
history(),
|
|
- baseFoldStyle,
|
|
|
|
|
|
+ foldGutter({
|
|
|
|
+ openText: "▾",
|
|
|
|
+ closedText: "▸",
|
|
|
|
+ }),
|
|
EditorState.allowMultipleSelections.of(true),
|
|
EditorState.allowMultipleSelections.of(true),
|
|
indentOnInput(),
|
|
indentOnInput(),
|
|
defaultHighlightStyle.fallback,
|
|
defaultHighlightStyle.fallback,
|
|
@@ -227,6 +229,9 @@ export const basicSetup: Extension = [
|
|
rectangularSelection(),
|
|
rectangularSelection(),
|
|
highlightActiveLine(),
|
|
highlightActiveLine(),
|
|
highlightSelectionMatches(),
|
|
highlightSelectionMatches(),
|
|
|
|
+ searchConfig({
|
|
|
|
+ top: true,
|
|
|
|
+ }),
|
|
keymap.of([
|
|
keymap.of([
|
|
...closeBracketsKeymap,
|
|
...closeBracketsKeymap,
|
|
...defaultKeymap,
|
|
...defaultKeymap,
|