refactor: minor ui improvements
This commit is contained in:
@@ -18,7 +18,11 @@ import { lineNumbers, highlightActiveLineGutter } from "@codemirror/gutter"
|
||||
import { defaultKeymap } from "@codemirror/commands"
|
||||
import { bracketMatching } from "@codemirror/matchbrackets"
|
||||
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 { commentKeymap } from "@codemirror/comment"
|
||||
import { rectangularSelection } from "@codemirror/rectangular-selection"
|
||||
@@ -207,17 +211,15 @@ export const baseHighlightStyle = HighlightStyle.define([
|
||||
{ tag: t.invalid, color: editorInvalidColor },
|
||||
])
|
||||
|
||||
const baseFoldStyle = foldGutter({
|
||||
openText: "▾",
|
||||
closedText: "▸",
|
||||
})
|
||||
|
||||
export const basicSetup: Extension = [
|
||||
lineNumbers(),
|
||||
highlightActiveLineGutter(),
|
||||
highlightSpecialChars(),
|
||||
history(),
|
||||
baseFoldStyle,
|
||||
foldGutter({
|
||||
openText: "▾",
|
||||
closedText: "▸",
|
||||
}),
|
||||
EditorState.allowMultipleSelections.of(true),
|
||||
indentOnInput(),
|
||||
defaultHighlightStyle.fallback,
|
||||
@@ -227,6 +229,9 @@ export const basicSetup: Extension = [
|
||||
rectangularSelection(),
|
||||
highlightActiveLine(),
|
||||
highlightSelectionMatches(),
|
||||
searchConfig({
|
||||
top: true,
|
||||
}),
|
||||
keymap.of([
|
||||
...closeBracketsKeymap,
|
||||
...defaultKeymap,
|
||||
|
||||
Reference in New Issue
Block a user