fix: move cursor to the beginning of an egc in Cursor.clamp_to_buffer
closes #317
This commit is contained in:
parent
f6234e6048
commit
1d1d828097
1 changed files with 2 additions and 0 deletions
|
|
@ -33,6 +33,8 @@ pub fn clamp_to_buffer(self: *Self, root: Buffer.Root, metrics: Metrics) void {
|
||||||
self.col = root.line_width(self.row, metrics) catch 0;
|
self.col = root.line_width(self.row, metrics) catch 0;
|
||||||
} else {
|
} else {
|
||||||
self.col = @min(self.col, root.line_width(self.row, metrics) catch 0);
|
self.col = @min(self.col, root.line_width(self.row, metrics) catch 0);
|
||||||
|
_, _, const offset = root.egc_at(self.row, self.col, metrics) catch return;
|
||||||
|
self.col -= @min(self.col, offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue