Skip to content

Commit

Permalink
Add basic mermaid syntax support
Browse files Browse the repository at this point in the history
  • Loading branch information
lirsacc committed Nov 28, 2023
1 parent 02400ee commit 455d5b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as cmSearch from "@codemirror/search";
import { EditorState } from "@codemirror/state";
import { EditorView } from "@codemirror/view";
import * as cmView from "@codemirror/view";
import { mermaid, foldByIndent } from "codemirror-lang-mermaid";
import { yCollab, yUndoManagerKeymap } from "y-codemirror.next";
import * as Y from "yjs";

Expand Down Expand Up @@ -40,6 +41,7 @@ const Editor = ({ text, provider }: EditorProps) => {
cmView.dropCursor(),
EditorState.allowMultipleSelections.of(true),
cmLanguage.indentOnInput(),
mermaid(),
cmLanguage.syntaxHighlighting(cmLanguage.defaultHighlightStyle, {
fallback: true,
}),
Expand All @@ -50,6 +52,7 @@ const Editor = ({ text, provider }: EditorProps) => {
cmView.crosshairCursor(),
cmView.highlightActiveLine(),
cmSearch.highlightSelectionMatches(),
foldByIndent(),
cmView.keymap.of([
...cmAutocomplete.closeBracketsKeymap,
...cmCommands.defaultKeymap,
Expand Down

0 comments on commit 455d5b2

Please sign in to comment.