Skip to content

Commit

Permalink
feat: enable syntax highlighting in cm6 (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers authored Oct 29, 2022
1 parent b7781a7 commit 1cc6615
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"dependencies": {
"@codemirror/state": "^6.1.1",
"@codemirror/view": "^6.2.3",
"@codemirror/language": "https://github.com/lishid/cm-language",
"@popperjs/core": "^2.11.2",
"child_process": "^1.0.2",
"eta": "github:SilentVoid13/eta#custom-eta"
Expand Down
4 changes: 4 additions & 0 deletions src/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Autocomplete } from "editor/Autocomplete";

import "editor/mode/javascript";
import "editor/mode/custom_overlay";
import { StreamLanguage } from "@codemirror/language";
//import "editor/mode/show-hint";

const TP_CMD_TOKEN_CLASS = "templater-command";
Expand All @@ -30,6 +31,9 @@ export class Editor {
async setup(): Promise<void> {
await this.registerCodeMirrorMode();
this.plugin.registerEditorSuggest(new Autocomplete(app));
this.plugin.registerEditorExtension(
StreamLanguage.define(window.CodeMirror.getMode({}, { name: 'templater' }) as any)
)
}

async jump_to_next_cursor_location(
Expand Down

0 comments on commit 1cc6615

Please sign in to comment.