Commit eaa66a9
authored
fix: [CLI-273] use negative offset for first() (#15)
### What changed?
Changed the offset in `first()` to reflect that we are moving back by the rendered text length.
### Why?
In the rendering code, cursorOffset is used after rendering the text to move the cursor into the desired position. On first() we were incorrectly using a offset of 0 which would not move the caret. This resulted in the caret being stuck where it was (at the end of the line).
Used the script in the draft PR above to test:
[prompts_testing.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.stg.graphite.com/user-attachments/thumbnails/42757caa-0133-4e98-be5a-214e8ca54fe3.mov" />](https://app.stg.graphite.com/user-attachments/video/42757caa-0133-4e98-be5a-214e8ca54fe3.mov)1 parent 5855b14 commit eaa66a9
2 files changed
+35
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
105 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
107 | 120 | | |
108 | | - | |
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
113 | 125 | | |
114 | | - | |
| 126 | + | |
115 | 127 | | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
124 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
125 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
126 | 151 | | |
127 | | - | |
128 | 152 | | |
129 | 153 | | |
130 | 154 | | |
| |||
0 commit comments