refactor: add Cursor.egc_at helper function
This commit is contained in:
parent
b7aa8cd6a7
commit
67c386d5b7
1 changed files with 4 additions and 0 deletions
|
@ -176,6 +176,10 @@ fn is_at_end(self: *const Self, root: Buffer.Root, metrics: Metrics) bool {
|
|||
return if (self.row < root.lines()) self.col == root.line_width(self.row, metrics) catch 0 else true;
|
||||
}
|
||||
|
||||
pub fn egc_at(self: *const Self, root: Buffer.Root, metrics: Metrics) error{NotFound}!struct { []const u8, usize, usize } {
|
||||
return root.egc_at(self.row, self.col, metrics);
|
||||
}
|
||||
|
||||
pub fn test_at(self: *const Self, root: Buffer.Root, pred: *const fn (c: []const u8) bool, metrics: Metrics) bool {
|
||||
return root.test_at(pred, self.row, self.col, metrics);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue