|
6 | 6 | - Pre-existing lint errors in page.tsx and components exist; ignore them |
7 | 7 | - Operator functions live in src/lib/simulator/vim/operators.ts |
8 | 8 | - When spreading state with null assignments, always add explicit `: VimState` type annotation to avoid TypeScript inference narrowing |
| 9 | +- Text objects live in src/lib/simulator/vim/textObjects.ts; use executeTextObject(state, type, objectKey) as main entry point |
9 | 10 |
|
10 | 11 | --- |
11 | 12 |
|
@@ -109,3 +110,28 @@ Thread: http://localhost:8317/threads/T-019bbbaf-e594-7431-bfd1-469e62504d88 |
109 | 110 | - getRegisterContent() retrieves from any register type (named, numbered, special) |
110 | 111 | - deleteRange handles both linewise and charwise deletions with proper cursor positioning |
111 | 112 | --- |
| 113 | + |
| 114 | +## 2026-01-14 - US-005 |
| 115 | +Thread: http://localhost:8317/threads/T-019bbbb7-f910-7378-88d8-49d010166129 |
| 116 | +- Implemented complete vim text objects in src/lib/simulator/vim/textObjects.ts: |
| 117 | + - iw/aw: inner/a word (aw includes trailing/leading space) |
| 118 | + - iW/aW: inner/a WORD (whitespace-delimited) |
| 119 | + - is/as: inner/a sentence (ends at .!?) |
| 120 | + - ip/ap: inner/a paragraph (blank line separated) |
| 121 | + - i"/a": inner/a double-quoted string |
| 122 | + - i'/a': inner/a single-quoted string |
| 123 | + - i`/a`: inner/a backtick string |
| 124 | + - i(/a( or ib/ab: inner/a parentheses block |
| 125 | + - i[/a[: inner/a bracket block |
| 126 | + - i{/a{ or iB/aB: inner/a brace block |
| 127 | + - i</a<: inner/a angle bracket block |
| 128 | + - it/at: inner/a tag block (HTML/XML) |
| 129 | +- Updated src/lib/simulator/vim/index.ts to export textObjects |
| 130 | +- Files changed: 2 files (textObjects.ts new, index.ts updated) |
| 131 | +- **Learnings for future iterations:** |
| 132 | + - Text objects return TextObjectResult with startLine/startCol/endLine/endCol/linewise |
| 133 | + - executeTextObject(state, type, objectKey) is the main entry point with type "i" or "a" |
| 134 | + - textObjectToMotionResult() converts TextObjectResult to MotionResult for operator integration |
| 135 | + - Bracket matching uses depth tracking to handle nested brackets |
| 136 | + - Tag matching handles nested tags with same name using depth counter |
| 137 | +--- |
0 commit comments