fix: insert right char on move failure in smart_insert_pair_close

closes #228
This commit is contained in:
CJ van den Berg 2025-04-09 14:50:19 +02:00
parent 105be85d0f
commit 9892e693b0
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -4387,7 +4387,9 @@ pub const Editor = struct {
break :blk;
};
if (std.mem.eql(u8, egc, chars_right)) {
cursel.cursor.move_right(root, self.metrics) catch {};
cursel.cursor.move_right(root, self.metrics) catch {
root = try self.insert(root, cursel, chars_right, b.allocator);
};
} else {
root = try self.insert(root, cursel, chars_right, b.allocator);
}