mode_copy.zig — yankSelection computes wrong bounds for reverse selectionsmode_copy.zig — yankSelection computes wrong bounds for reverse selectionsFile: src/mode_copy.zig:205–206
Severity: HIGH
Status: ✅ FIXED — replaced incorrect sy == start_y / ey == end_y checks with start_is_top flag matching isSelected logic. Test added for reverse multi-line selection.
const sx = if (sy == self.selection.start_y) self.selection.start_x else 0;
const ex = if (ey == self.selection.end_y) self.selection.end_x else grid.width -| 1;
When start_y > end_y (user selected bottom-to-top): sy = end_y, so sy != start_y, so sx = 0 — should be end_x. ey = start_y, so ey != end_y, so ex = grid.width - 1 — should be start_x. Result: yanked text includes extra characters on the first and last lines. Compare with isSelected (lines 167–169) which handles this correctly using start_is_top.