feat(prose): list shortcuts — S5 (#115)
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
Markdown lists in the prose editor become structural: Tab/⇧Tab indent/outdent the item under the caret (wrapped lines ride along, caret follows), ⌥↑/⌥↓ move the item with its subtree among siblings. Every structural edit is one range replacement — a single undo step over the plain mode-B store (ADR-0010 stands). List parents fold visually: a gutter chevron collapses children to near-zero height with a rust ▸ and a "⋯ N" summary after the parent's line. Folding is view state — the buffer never changes (ADR-0013's posture carried to prose). Field findings baked in: SwiftUI-hosted TextKit2 never calls NSTextView.draw(_:) and every NSTextLayoutManager fragment query returns empty, so the chrome renders offscreen into a layer-contents image and geometry comes from firstRect(forCharacterRange:) (screen → window → view). Includes the finish-audit round: sibling block-for- block ⌥-move swap (was stealing the sibling's subtree), blank-line indent dirt, fold-key dedupe, hidden-parent chevron filtering, plain-click-only hit zone, no-parents raster skip. Closes #115 [Generated by AI]
This commit is contained in:
1 parent
c0513aae85
commit
803682f3f0
12 files changed
+1145
-7
No files matched your search
@@ -405,7 +405,9 @@ nonisolated enum ProsePresenter {
|
||||
// MARK: Pattern helpers
|
||||
|
||||
// Marker patterns (regex literals, like the inline ones below).
|
||||
private nonisolated(unsafe) static let listMarkerPattern = /^\s*(?:[-*+]|\d{1,9}[.)])(?:\s+|$)/
|
||||
// listMarkerPattern is internal — ProseList's marker math must agree
|
||||
// with classify()'s list detection (#115).
|
||||
nonisolated(unsafe) static let listMarkerPattern = /^\s*(?:[-*+]|\d{1,9}[.)])(?:\s+|$)/
|
||||
private nonisolated(unsafe) static let quoteMarkerPattern = /^(?:\s*>(?:\s|$))*/
|
||||
|
||||
/// UTF-16 NSRange of the marker in `lineText`, or nil.
|
||||
|
||||
Reference in new issue
Block a user