summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 12:22:36 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitc06a666ca4daf0068372e825807007f7bbcf5523 (patch)
tree1c5d7ac673c663586c0d84595e7a54d88d7021f7 /src/ninep/ctl.zig
parent3f4ba3490904da77c4b244c21017fcf94f3bb198 (diff)
downloadpardes-c06a666ca4daf0068372e825807007f7bbcf5523.tar.gz
pardes-c06a666ca4daf0068372e825807007f7bbcf5523.zip
A clamped Recent range ends at a line's last character, never swallowing its newline
A range past the end of a file that had shrunk was clamped to the empty line after its final newline and to one past a line's last character, so the selection took the newline in. Its ends now clamp to the last line and to its last character, as addr's L:C does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 7321f569..d815632d 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2442,6 +2442,8 @@ test "a remembered place is clamped to the file as it is now, its selection's tw
try testing.expect(std.mem.endsWith(u8, back.file.?.path, "/c.txt"));
try testing.expect(back.body.cur_row <= 1);
try testing.expect(back.body.vsel.active);
+ // Its ends clamped to the last character, `two`'s `o`, not its newline.
+ try testing.expect(back.body.cur_col <= 2 and back.body.vsel.col <= 2);
}
test "size is monotonic: growing is never refused, and a size once taken is taken again" {