Commit cb30e50
flash: lift conceal-mode gate so labels actually substitute glyphs
Side-by-side comparison with neovim+flash.nvim revealed that fresh's
flash labels were styled (magenta cell) but still showed the
*original character* underneath, where flash.nvim correctly shows
the assigned label letter. Root cause: addConceal calls were
landing in state but the renderer's apply_conceal_ranges was gated
on `is_compose && !state.conceals.is_empty()`, so source-mode
buffers (the common case for flash) never saw the substitution.
Lifting the gate is safe: every plugin that adds source-mode
conceals already self-checks the buffer's view mode (e.g.
markdown_compose's `isComposing` helper), so plugins that never
intend to substitute in source mode keep their existing behaviour.
flash and any other plugin that legitimately wants overlay-style
cell substitution in source mode now gets it.
Why no test caught this:
The existing e2e tests assert on cursor_position() after pressing a
label. The labeler's logic was correct — the right label letter
was assigned, the keypress dispatched correctly, the cursor landed
at the right byte. None of the assertions touched the *rendered
glyph at the label position*, so the visual bug slipped through.
Adds flash_label_substitutes_rendered_glyph: drives flash to a
labelled state and asserts on `screen_to_string()` that the cell
right after at least one match has been substituted with a pool
letter (so `hsllo` etc. instead of plain `hello`). Also asserts
that fewer than N plain occurrences of the original word survive,
catching the case where conceal silently no-ops.
Comparison with flash.nvim now matches: same labels, same positions,
same letters substituted. Verified by tmux side-by-side run with
identical sample.rs file and identical cursor position.
Tests: 6 flash + 46 vi_mode + 41 markdown_compose e2e tests all
pass. Showcase GIF regenerated.1 parent ea3ec22 commit cb30e50
3 files changed
Lines changed: 88 additions & 4 deletions
File tree
- crates/fresh-editor
- src/view/ui/split_rendering
- tests/e2e
- docs/blog/productivity/flash-jump
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
196 | 274 | | |
197 | 275 | | |
198 | 276 | | |
| |||
Loading
0 commit comments