Commit 705dc5f
committed
astro(fix[prompt-space]): Include trailing whitespace in non-selectable prefix
why: Cycle 75 split the bundled prompt into a select-none span,
but the trailing space stayed in the selectable rest-of-line span.
Triple-clicking the line still selected a leading space before
pip, which the user flagged as still-broken on /packages/sphinx-
autodoc-api-style/.
what:
- Widen the bundled-prompt regex to capture trailing whitespace
in the non-selectable prefix. Selection now starts at the
command body, not at a leading space.
- Add hoistTrailingWhitespace() running after the exact-match
pass: when a prompt span was tagged, check its next-sibling
span for leading whitespace and split it into a select-none
prefix between them. Mirrors the bundled-prompt fix for
Shikis Python tokenization where the prompt and its trailing
space land in adjacent spans.
Verified live: pip install line splits as
<span class=select-none>$ </span><span>pip install ...</span>
with computed user-select: none on the prefix. Triple-click
starts at pip.
1446 pytest, 246 vitest theme + 81 dogfood, biome/mypy/ruff
clean, 242-page build green.1 parent 1191d5e commit 705dc5f
2 files changed
Lines changed: 78 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | | - | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
117 | 115 | | |
118 | | - | |
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
122 | 119 | | |
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 123 | + | |
| 124 | + | |
132 | 125 | | |
133 | 126 | | |
134 | 127 | | |
135 | 128 | | |
136 | 129 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 130 | + | |
| 131 | + | |
140 | 132 | | |
141 | 133 | | |
142 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
143 | 168 | | |
144 | 169 | | |
145 | 170 | | |
| 171 | + | |
| 172 | + | |
146 | 173 | | |
147 | 174 | | |
148 | 175 | | |
| 176 | + | |
149 | 177 | | |
150 | 178 | | |
151 | 179 | | |
| |||
154 | 182 | | |
155 | 183 | | |
156 | 184 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | 185 | | |
161 | 186 | | |
162 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
170 | | - | |
| 175 | + | |
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
181 | 191 | | |
182 | 192 | | |
183 | 193 | | |
| |||
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
200 | | - | |
| 210 | + | |
201 | 211 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
207 | 216 | | |
208 | 217 | | |
209 | 218 | | |
| |||
213 | 222 | | |
214 | 223 | | |
215 | 224 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | 225 | | |
220 | | - | |
| 226 | + | |
221 | 227 | | |
222 | 228 | | |
223 | | - | |
224 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
225 | 233 | | |
226 | 234 | | |
227 | 235 | | |
228 | | - | |
| 236 | + | |
229 | 237 | | |
230 | 238 | | |
231 | 239 | | |
| |||
236 | 244 | | |
237 | 245 | | |
238 | 246 | | |
239 | | - | |
| 247 | + | |
240 | 248 | | |
241 | | - | |
| 249 | + | |
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
| |||
0 commit comments