From 6bad403ac3577271804e8f0cee6f48822da0244e Mon Sep 17 00:00:00 2001 From: Matthew Meyers Date: Mon, 28 Sep 2020 10:11:19 -0700 Subject: [PATCH] feat: Adds flag for syntax decorations --- package.json | 8 +++++++- src/features/syntaxDecorations.ts | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 94bb1d3b..61d529b9 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/src/features/syntaxDecorations.ts b/src/features/syntaxDecorations.ts index 6a110098..805be530 100644 --- a/src/features/syntaxDecorations.ts +++ b/src/features/syntaxDecorations.ts @@ -15,6 +15,7 @@ import { isMdEditor, mathEnvCheck, refPattern, + getMemoConfigProperty, } from '../utils'; /* @@ -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) => {