summaryrefslogtreecommitdiff
path: root/core/body_layer.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 10:16:05 -0300
committerGabriel Schneider <[email protected]>2026-11-20 11:35:34 -0300
commit1374e668fe568ad4f7f70c06156c1ecdbb8840b9 (patch)
tree1529f1e551f73bd8843691d8588f8942a13cf2b7 /core/body_layer.zig
parentfe0efce585bdd001d15db3b7fee7bf125af4168f (diff)
downloadpardes-1374e668fe568ad4f7f70c06156c1ecdbb8840b9.tar.gz
pardes-1374e668fe568ad4f7f70c06156c1ecdbb8840b9.zip
body_layer: a file pane's caret left of a view scrolled sideways is off the view, not drawn in the line-number gutter: renderBody showed the caret wherever gutter + its display offset was >= 0, and an offset of -4 (one wheel notch right, the caret at column 0) put it 3 columns into the 7-column gutter; a busy session drew the first of two notches as a frame of its own, so the terminal's cursor stayed there (process-test hscroll's 'wheeled': cursor 3,9 against 7,9, 6 of 30 runs pinned to one CPU, once in 3 whole runs at a load of 32-40); File.zig's test 'a caret left of a view scrolled sideways...' failed before; after, pinned to one CPU: 0 of 30; the five together: tui core-test 859/1014, shell-test 1055/1058, pane-test 183/184, term-test 17/17, kitty-test 45/45, behaviour-test 275/275 and --replay, process-test 0 of 144 (cmdexit once, again alone), daemon.py in every mode, both soaks diverged 0 unequal 0, gui unit-test 1651/1655 (BaselineHarnessMismatch), the frame and perf gate against tree2 PASS
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/body_layer.zig')
-rw-r--r--core/body_layer.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/body_layer.zig b/core/body_layer.zig
index 7dc097ad..1582136c 100644
--- a/core/body_layer.zig
+++ b/core/body_layer.zig
@@ -512,7 +512,10 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane
)
else
ccol;
- if (prow >= pane.tag_rows and cx >= 0 and prow < body_bottom and cx < tw)
+ // Left of a view scrolled sideways it is off the view, not
+ // in the gutter.
+ const left: i32 = if (pane.file != null) panes.File.gutterWidth(pane) else 0;
+ if (prow >= pane.tag_rows and cx >= left and prow < body_bottom and cx < tw)
s.cursor = .{ .x = tx + @as(u16, @intCast(cx)), .y = body_y + @as(u16, @intCast(prow - pane.tag_rows)), .bar = pane.body.mode == .insert };
}
} else if (pane.terminal != null) visible: {