From a87f917559e3712d36e5809d1f457fbf78c8266e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 24 Oct 2026 14:32:27 -0300 Subject: 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 --- src/draw.zig | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/draw.zig') 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 -- cgit v1.3