diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-24 14:32:27 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-24 20:59:59 -0300 |
| commit | a87f917559e3712d36e5809d1f457fbf78c8266e (patch) | |
| tree | f22bcaa16e1b4f384f0def5c46acab814796cd84 /src/draw.zig | |
| parent | 114757fa94bd38b7620589709965d5f46e317b12 (diff) | |
| download | pardes-a87f917559e3712d36e5809d1f457fbf78c8266e.tar.gz pardes-a87f917559e3712d36e5809d1f457fbf78c8266e.zip | |
anim 4: the thin insert-mode cursor glides as the block does, a small move eases instead of landing, and the cursor rides a scroll's glide with its text
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/draw.zig b/src/draw.zig index 3ba5801f..92fd8205 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -211,9 +211,10 @@ fn focusedCursorBox(p: *const Pardes, s: *const Surface) ?animation.Box { } /// G3 (docs/render-pipeline.md ยง5.4): the focused cursor on its springs, -/// at the Motion flavour's pace, a jump gliding and a step or a keystroke in -/// insert mode landing at once; blinking unless typing. A pixel shell's: a -/// grid's cursor is the terminal's own. +/// at the Motion flavour's pace, a jump gliding and a step easing over a +/// few frames (CursorGlide.aim), the thin insert-mode caret as the block; +/// blinking unless typing. A pixel shell's: a grid's cursor is the +/// terminal's own. /// /// The springs hold the cursor where the pane's final layout puts it, and /// the quad is drawn through the pane's frame (paneFrame): while the pane @@ -237,7 +238,9 @@ fn glideCursor(p: *Pardes, s: *Surface) void { return; }; const motion = animation.Motion.of(p.settings.motion); - var snap = if (s.cursor) |cursor| cursor.bar else false; + // The thin insert-mode caret glides as the block does (a jump smears + // and bows, a step eases); only a scroll, below, lands it. + var snap = false; var frame: PaneFrame = .{}; // In a column's or the workspace's tag the cursor is not the pane's, // and does not move with it. @@ -256,8 +259,6 @@ fn glideCursor(p: *Pardes, s: *Surface) void { // The pane moved in the layout: the springs move with it (its // own cursor's; one in a column's tag stays). if (inside) p.cursor_glide.shift(origin[0] - view.origin[0], origin[1] - view.origin[1]); - // Typing never trails: insert mode lands every move. - if (pane.body.mode == .insert) snap = true; // Scrolled (a file's view, a terminal's output): the quad moves // with the text and lands, never gliding against text that // jumped (every Enter at a prompt scrolls one and moves the |
