mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-10 21:53:34 +08:00
Started codemirror update, In broken state
This commit is contained in:
32
resources/js/code/setups.js
Normal file
32
resources/js/code/setups.js
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
import {keymap, highlightSpecialChars, drawSelection, highlightActiveLine, dropCursor,
|
||||
rectangularSelection, lineNumbers, highlightActiveLineGutter} from "@codemirror/view"
|
||||
import {defaultHighlightStyle, syntaxHighlighting, bracketMatching,
|
||||
foldKeymap} from "@codemirror/language"
|
||||
import {defaultKeymap, history, historyKeymap} from "@codemirror/commands"
|
||||
import {EditorState} from "@codemirror/state"
|
||||
|
||||
import {modesAsStreamLanguages} from "./modes";
|
||||
|
||||
|
||||
export function viewer() {
|
||||
return [
|
||||
lineNumbers(),
|
||||
highlightActiveLineGutter(),
|
||||
highlightSpecialChars(),
|
||||
history(),
|
||||
drawSelection(),
|
||||
dropCursor(),
|
||||
syntaxHighlighting(defaultHighlightStyle, {fallback: true}),
|
||||
bracketMatching(),
|
||||
rectangularSelection(),
|
||||
highlightActiveLine(),
|
||||
keymap.of([
|
||||
...defaultKeymap,
|
||||
...historyKeymap,
|
||||
...foldKeymap,
|
||||
]),
|
||||
EditorState.readOnly.of(true),
|
||||
...modesAsStreamLanguages(),
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user