Add a Ctrl+Shift+X strikethrough shortcut - #15
Conversation
Wrap the selection in ~~ markers, render the content struck through, and hide the markers like the other inline markup. The formatting shortcuts now also toggle: pressing Ctrl+B, Ctrl+I, or Ctrl+Shift+X again removes the markers instead of stacking another pair.
|
Great idea, this would help me out too! |
`*` is also the first half of `**`, so toggleWrap's unwrap branches matched the inner asterisk of a bold pair: Ctrl+I on `bold` selected inside `**bold**` rewrote it to `*bold*`, silently deleting the bold instead of adding italic. Both unwrap branches now refuse when the character just outside the marker repeats it, falling through to the wrap path and producing `***bold***`, which is what Ctrl+I did before this shortcut moved to toggleWrap. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Reviewed this and pushed one fix to the branch ( Fixed: Still open:
The README line is accurate as written, and stays accurate with the fix — the fix restores what One thing worth flagging for the maintainer rather than changing here: this makes Heads up that this overlaps #8 (link URL hover) and #17 (focus mode) on the same files. #17 is the one to watch: you both rewrite the Tests pass (14 passed, 0 failed). |
Adds a strikethrough shortcut alongside the existing bold/italic ones.
Ctrl+Shift+Xwraps the selection in~~markers (the shortcut Slack, VS Code, and Obsidian use).~~text~~struck through and hides the markers exactly like**and*, so the caret skips over them too.Ctrl+B,Ctrl+I, orCtrl+Shift+Xon already-wrapped text (or with the caret inside the markers) removes the markers instead of stacking another pair. The wrap/unwrap logic moved intoEditorMutations.jsso it's covered by the test harness.Ctrl+?reference and the README.Two new tests (
findsStrikethroughRanges,togglesWrappedSelection); all 14 pass.