โ– humdrum codex / glint v1.0.2
license AGPL-3.0

โ† issues

TASK-009 Wrap selection in markdown formatting

๐Ÿ Done feature priority: medium release-1

created 2026-06-29 16:26 ยท updated 2026-06-30 00:23

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

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)