Fix key bindings for toggleComment and toggleBlockComment commands that were previously working.

Add toggleComment, toggleBlockComment and toggleLineComment commands to command palette.
This commit is contained in:
Jonatan Heyman 2025-04-25 15:21:33 +02:00
parent 6b8ad1661b
commit 5c6b366aee
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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"),