summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:22:44 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:16:28 -0300
commit9c10736675bb52ee893b529fada0afe033a18288 (patch)
tree75357cb5ecaac24475d568cc6209d0339aeaf361
parent93d3561f32f78013edd4fa039a944356a28bcbb4 (diff)
downloadpardes-9c10736675bb52ee893b529fada0afe033a18288.tar.gz
pardes-9c10736675bb52ee893b529fada0afe033a18288.zip
edit: normalYank's tail is selText's: the selection, else msel's rows, else the 1-wide range at the cursor
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
-rw-r--r--src/edit.zig13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/edit.zig b/src/edit.zig
index 707b576f..72cfe31a 100644
--- a/src/edit.zig
+++ b/src/edit.zig
@@ -1207,18 +1207,7 @@ pub fn normalYank(p: *Pardes, t: *Text) void {
setYank(p, text);
return;
};
- if (t.vsel.active) {
- setYank(p, vselText(p, t));
- return;
- }
- if (t.msel.active) {
- setYank(p, yankRows(p, t, @min(t.msel.r0, t.msel.r1), @max(t.msel.r0, t.msel.r1)));
- } else {
- const save = t.vsel;
- t.vsel = .{ .active = true, .row = t.cur_row, .col = t.cur_col, .explicit = false };
- setYank(p, vselText(p, t));
- t.vsel = save;
- }
+ setYank(p, if (t.vsel.active) vselText(p, t) else selText(p, t));
}
pub fn pasteText(p: *Pardes, t: *Text, y0: []const u8, before: bool, count: usize) void {