fix(Buffer): get_range should only use direction normalized selections

This commit is contained in:
CJ van den Berg 2024-06-13 10:39:18 +02:00
parent 2faa5c6b9b
commit b4c7094205

View file

@ -577,9 +577,9 @@ const Node = union(enum) {
var ctx: Ctx = .{ .sel = sel, .out = copy_buf };
ctx.sel.normalize();
if (sel.begin.eql(sel.end))
if (ctx.sel.begin.eql(ctx.sel.end))
return error.Stop;
self.walk_egc_forward(sel.begin.row, Ctx.walker, &ctx, plane_) catch |e| return switch (e) {
self.walk_egc_forward(ctx.sel.begin.row, Ctx.walker, &ctx, plane_) catch |e| return switch (e) {
error.NoSpaceLeft => error.NoSpaceLeft,
else => error.Stop,
};