diff --git a/docs/changelog.md b/docs/changelog.md index 2f8ee5f..0004289 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -8,6 +8,7 @@ Here are the most notable changes in each release. For a more detailed list of c - Fix issue where the second command in the command palette, instead of the first command, was selected when the palette is opened. - Change name/label of some commands in the command palette, and make commands searchable using their key names as well. +- Fix key bindings for toggleComment and toggleBlockComment commands that were previously working. ## 2.2.0 diff --git a/src/editor/commands.js b/src/editor/commands.js index 281a96c..7f9b753 100644 --- a/src/editor/commands.js +++ b/src/editor/commands.js @@ -9,6 +9,7 @@ import { simplifySelection, splitLine, insertNewlineAndIndent, + toggleComment, toggleBlockComment, toggleLineComment, } from "@codemirror/commands" import { foldCode, unfoldCode } from "@codemirror/language" import { selectNextOccurrence } from "@codemirror/search" @@ -140,6 +141,9 @@ const HEYNOTE_COMMANDS = { transposeChars: cmdLessContext(transposeChars, "Edit", "Transpose characters"), insertNewlineAndIndent: cmdLessContext(insertNewlineAndIndent, "Edit", "Insert newline and indent"), insertNewlineContinueMarkup: cmdLessContext(insertNewlineContinueMarkup, "Markdown", "Insert newline and continue todo lists/block quotes"), + toggleComment: cmdLessContext(toggleComment, "Edit", "Toggle comment"), + toggleBlockComment: cmdLessContext(toggleBlockComment, "Edit", "Toggle block comment"), + toggleLineComment: cmdLessContext(toggleLineComment, "Edit", "Toggle line comment"), } // selection mark-mode:ify all cursor/select commands from CodeMirror diff --git a/src/editor/keymap.js b/src/editor/keymap.js index 29df880..57449cc 100644 --- a/src/editor/keymap.js +++ b/src/editor/keymap.js @@ -87,6 +87,9 @@ export const DEFAULT_KEYMAP = [ cmd("Alt-Shift-f", "formatBlockContent"), + cmd("Mod-/", "toggleComment"), + cmd("Alt-Shift-a", "toggleBlockComment"), + // search //cmd("Mod-f", "openSearchPanel"), //cmd("F3", "findNext"),