From f5f7405928c38fa90213a126938278d7422a91cd Mon Sep 17 00:00:00 2001 From: yzhang <7588612+yzhang-gh@users.noreply.github.com> Date: Mon, 25 Dec 2023 21:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20#1367=20(!suggestWidgetVisible?= =?UTF-8?q?=20||=20config.editor.acceptSuggestionOnEnter=20=3D=3D=20'off')?= =?UTF-8?q?;=20also=20#1358=20follow-up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 40 ++++++++++++++++++++++------------------ package.nls.json | 1 + 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 6f904193..b9623de1 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "version": "3.5.1", "publisher": "yzhang", "engines": { - "vscode": "^1.72.0" + "vscode": "^1.77.0" }, "categories": [ "Programming Languages", @@ -28,7 +28,6 @@ "onLanguage:markdown", "onLanguage:rmd", "onLanguage:quarto", - "onCommand:markdown.extension.printToHtmlBatch", "workspaceContains:README.md" ], "main": "./dist/node/main.js", @@ -183,29 +182,29 @@ ], "editor/title": [ { - "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/", + "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/ && config.markdown.extension.showActionButtons", "command": "markdown.extension.editing.toggleBold", - "group": "navigation@1_1" + "group": "navigation@1" }, { - "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/", + "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/ && config.markdown.extension.showActionButtons", "command": "markdown.extension.editing.toggleItalic", - "group": "navigation@1_2" - }, - { - "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/", - "command": "markdown.extension.checkTaskList", - "group": "navigation@1_3" + "group": "navigation@2" }, { - "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/", + "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/ && config.markdown.extension.showActionButtons", "command": "markdown.extension.editing.toggleCodeSpan", - "group": "navigation@1_4" + "group": "navigation@3" }, { - "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/", + "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/ && config.markdown.extension.showActionButtons", "command": "markdown.extension.editing.toggleList", - "group": "navigation@1_5" + "group": "navigation@4" + }, + { + "when": "editorLangId =~ /^markdown$|^rmd$|^quarto$/ && config.markdown.extension.showActionButtons", + "command": "markdown.extension.checkTaskList", + "group": "navigation@5" } ] }, @@ -248,18 +247,18 @@ { "command": "markdown.extension.onEnterKey", "key": "enter", - "when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && !suggestWidgetVisible && !editorHasMultipleSelections && vim.mode != 'Normal' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && vim.mode != 'SearchInProgressMode' && vim.mode != 'CommandlineInProgress' && vim.mode != 'Replace' && vim.mode != 'EasyMotionMode' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'SurroundInputMode' && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv" + "when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && (!suggestWidgetVisible || config.editor.acceptSuggestionOnEnter == 'off') && !editorHasMultipleSelections && vim.mode != 'Normal' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && vim.mode != 'SearchInProgressMode' && vim.mode != 'CommandlineInProgress' && vim.mode != 'Replace' && vim.mode != 'EasyMotionMode' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'SurroundInputMode' && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv" }, { "command": "markdown.extension.onCtrlEnterKey", "key": "ctrl+enter", "mac": "cmd+enter", - "when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && !suggestWidgetVisible && !editorHasMultipleSelections && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv" + "when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && (!suggestWidgetVisible || config.editor.acceptSuggestionOnEnter == 'off') && !editorHasMultipleSelections && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv" }, { "command": "markdown.extension.onShiftEnterKey", "key": "shift+enter", - "when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && !suggestWidgetVisible && !editorHasMultipleSelections && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv" + "when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && (!suggestWidgetVisible || config.editor.acceptSuggestionOnEnter == 'off') && !editorHasMultipleSelections && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv" }, { "command": "markdown.extension.onTabKey", @@ -490,6 +489,11 @@ "default": true, "description": "%config.print.validateUrls.description%" }, + "markdown.extension.showActionButtons": { + "type": "boolean", + "default": false, + "markdownDeprecationMessage": "%config.showActionButtons.description%" + }, "markdown.extension.syntax.decorations": { "type": "boolean", "default": null, diff --git a/package.nls.json b/package.nls.json index 84487e40..d85c7eb1 100644 --- a/package.nls.json +++ b/package.nls.json @@ -40,6 +40,7 @@ "config.print.pureHtml.description": "Print current document to pure HTML (without any stylesheets).", "config.print.theme": "Theme of the exported HTML. Only affects code blocks.", "config.print.validateUrls.description": "Enable/disable URL validation when printing.", + "config.showActionButtons.description": "Show buttons (e.g. toggle bold, italic) on the editor toolbar.", "config.syntax.decorations.description": "(**Deprecated**) Use `#markdown.extension.theming.decoration.renderCodeSpan#` instead. See for details.", "config.syntax.decorationFileSizeLimit.description": "If a file is larger than this size (in byte/B), we won't attempt to render syntax decorations.", "config.syntax.plainTheme.description": "(**Experimental**) Report issue at .",