Skip to content

Inline-formatting keyboard shortcuts (⌘B/⌘I/⌘E/⌘⇧K) - #136

Draft
dylandeheer wants to merge 2 commits into
nodes-app:mainfrom
GetWeeve:feature/formatting-shortcuts
Draft

Inline-formatting keyboard shortcuts (⌘B/⌘I/⌘E/⌘⇧K)#136
dylandeheer wants to merge 2 commits into
nodes-app:mainfrom
GetWeeve:feature/formatting-shortcuts

Conversation

@dylandeheer

Copy link
Copy Markdown

What

Key equivalents for the coordinator's existing toggleable formatting actions:

  • ⌘B — bold (** wrap/unwrap; ***both****italic*)
  • ⌘I — italic (* wrap/unwrap)
  • ⌘E — inline code (` wrap/unwrap)
  • ⌘⇧K — link scaffold ([text](url))

How

NativeTextView.performKeyEquivalent (the existing ⌘↵ seam) routes exact-modifier matches to the didMarkdown* actions the context menu already drives, so wrap/unwrap/toggle semantics and caret placement are the proven ones covered by FormattingActionTests. Gated by MarkdownEditorConfiguration.formattingShortcutsEnabled (default ON, mirroring lists.helpersEnabled).

Plain ⌘K is deliberately NOT consumed: the engine has no binding on it, but it is a common embedder key (command palettes), so the link scaffold lives on ⌘⇧K only.

Defaults

On by default (the keys previously did nothing in the editor); embedders that own these keys set formattingShortcutsEnabled = false. Only exact modifier matches are consumed — every other ⌘-combination keeps flowing to menus and the responder chain, and read-only editors never consume the keys.

Tests

FormattingShortcutTests: dispatch for all four shortcuts including toggle round-trips, plain-⌘K and extra-modifier pass-through, the config gate, read-only pass-through, and the default. Full suite green.

Made with Cursor

dylandeheer and others added 2 commits August 3, 2026 22:59
The theme can recolor every element except heading text (it inherits
bodyText), and the heading config covers every metric except the face —
so an embedder that wants serif display headings over a sans body has
to fork. HeadingStyle.fontName picks a PostScript face for headings,
honored exactly so the chosen weight survives; an unresolvable name
falls back to the stock bold base font, like TaskCheckboxStyle's symbol
fallback. MarkdownEditorTheme.headingText colors heading text while the
`#` glyphs stay on headingMarker and inline constructs inside a heading
keep their own ink. Emphasis inside a heading still composes on top of
the configured face (traits added, family and per-level size kept).
Both knobs default to nil, which keeps styling identical to before.

Co-authored-by: Cursor <cursoragent@cursor.com>
Key equivalents for the coordinator's existing toggleable formatting
actions: ⌘B wraps/unwraps bold, ⌘I italic, ⌘E inline code, ⌘⇧K inserts
the [text](url) link scaffold. Wired in performKeyEquivalent so the
keys work regardless of menu setup, gated by
MarkdownEditorConfiguration.formattingShortcutsEnabled (default on,
mirroring the list helpers). Only exact modifier matches are consumed;
plain ⌘K is deliberately left untouched because it is a common embedder
binding (command palettes).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant