Skip to content

Commit 8164914

Browse files
committed
docs: Update progress.txt and prd.json for US-011
1 parent 88df92b commit 8164914

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

prd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
"Typecheck passes"
260260
],
261261
"priority": 11,
262-
"passes": false,
262+
"passes": true,
263263
"notes": ""
264264
},
265265
{

progress.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- When spreading state with null assignments, always add explicit `: VimState` type annotation to avoid TypeScript inference narrowing
99
- Text objects live in src/lib/simulator/vim/textObjects.ts; use executeTextObject(state, type, objectKey) as main entry point
1010
- Command mode functions live in src/lib/simulator/vim/commands.ts; use handleCommandModeKey() for key processing, executeCommand() for command execution
11+
- Macro functions live in src/lib/simulator/vim/macros.ts; use prepareMacroExecution() to get keystrokes array, caller is responsible for executing them
1112

1213
---
1314

@@ -278,3 +279,29 @@ Thread: http://localhost:8317/threads/T-019bbbdf-b4d1-744e-9ee9-9bf0fee9833e
278279
- SearchResult type used for all search operations
279280
- searchState in VimState tracks pattern, matches, currentMatchIndex, highlightEnabled
280281
---
282+
283+
## 2026-01-14 - US-011
284+
Thread: http://localhost:8317/threads/T-019bbbe5-fc2f-7144-a068-b3ca0e2e5c48
285+
- Implemented complete vim macro system in src/lib/simulator/vim/macros.ts:
286+
- q{a-z} starts recording to register via startMacroRecording()
287+
- q stops recording via stopMacroRecording()
288+
- Status bar message "recording @{register}" while recording
289+
- recordKeystroke() captures all keystrokes during recording
290+
- @{a-z} plays macro via prepareMacroExecution() which returns keystrokes array
291+
- @@ repeats last played macro using lastPlayedMacro state
292+
- {count}@{a-z} supported via count parameter in prepareMacroExecution()
293+
- Macros can call other macros (keystrokes include @ sequences)
294+
- Macro execution stops on error (caller handles by checking success flag)
295+
- getMacrosForDisplay() for :registers integration
296+
- encodeKeystrokeForMacro() handles special keys (<Esc>, <Enter>, <C-x>, etc.)
297+
- parseMacroKeystrokes() parses encoded sequences back to keystrokes
298+
- setMacroContent()/appendToMacro() for uppercase register append behavior
299+
- Updated src/lib/simulator/vim/index.ts to export macros module
300+
- Files changed: 2 files (macros.ts new, index.ts updated)
301+
- **Learnings for future iterations:**
302+
- Macros stored as string in state.macros[register], not as keystroke arrays
303+
- prepareMacroExecution() returns { state, keystrokes[], success, error? } - caller executes keystrokes
304+
- Use <Esc>, <Enter>, <C-x> notation for special keys in macro storage
305+
- recordingMacro state holds current register being recorded, null when not recording
306+
- lastPlayedMacro tracks register for @@ repeat functionality
307+
---

0 commit comments

Comments
 (0)