Description
Release 1. With a selection, a shortcut wraps it: bold (**), italic (_), inline code (backtick), and link (sel). Toggle off if already wrapped. With no selection, insert the empty pair with the cursor between. Needs free keys (Ctrl+B is new-inbox; pick non-conflicting bindings, document them). Keep the markup-visible invariant (the markers are inserted into the buffer).
Acceptance Criteria
- #1 Selection wraps in **/_/code/link via shortcuts; toggles off when already wrapped
- #2 No selection inserts the pair with the cursor inside
- #3 Bindings chosen to not clash with existing keys; documented
Implementation Notes
Impl editor inline-format ops (internal/editor/format.go): WrapBold/WrapItalic/WrapCode (symmetric toggle, markers inside or outside selection) + WrapLink (sel cursor in parens, toggle off full link). No selection inserts empty pair, cursor between. Bound Alt+s(bold/strong) Alt+i(italic) Alt+c(code) Alt+k(link) โ no clash with Alt+b/f/d or Ctrl set; routed via editor dispatch, single undo group (editKindOf structural). Documented in README Keys table. 10 TDD tests in format_test.go; full suite green.
Added surround-on-type: with a selection, typing * _ ` [ ( { < " ' ~ wraps the selection (nests on repeat, *โ**). Complements Alt+s/i/c/k. wrapPair+surroundSelection in format.go; dispatch routes it. 6 tests. (commit wvztmpxz)