Skip to content

Commit

Permalink
feat: Adds flag for syntax decorations
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Oct 9, 2020
1 parent 1ab1759 commit 6bad403
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@
"memo.linkBehavior.useLongRefsAlways": {
"default": false,
"scope": "resource",
"description": "Include folder paths into the created links. Paths are relative to the workspace root.",
"description": "Include folder paths into the created links. Paths are relative to the workspace root.",
"type": "boolean"
},
"memo.syntaxDecorations.enable": {
"default": true,
"scope": "resource",
"description": "Enable decorations for wiki-links and other special syntax. (Requires restart)",
"type": "boolean"
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/features/syntaxDecorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
isMdEditor,
mathEnvCheck,
refPattern,
getMemoConfigProperty,
} from '../utils';

/*
Expand Down Expand Up @@ -125,6 +126,10 @@ const updateDecorations = (textEditor?: TextEditor) => {
};

export const activate = (context: ExtensionContext) => {
if (!getMemoConfigProperty('syntaxDecorations.enable', true)) {
return;
}

context.subscriptions.push(
window.onDidChangeActiveTextEditor(updateDecorations),
workspace.onDidChangeTextDocument((event) => {
Expand Down

0 comments on commit 6bad403

Please sign in to comment.