refactor: add selection_pos_to_width and get_replace_selection functions
This commit is contained in:
parent
390fbd51ff
commit
6ae176a8ac
2 changed files with 14 additions and 0 deletions
|
|
@ -5602,6 +5602,11 @@ pub const Editor = struct {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn selection_pos_to_width(self: *Self, sel_: Selection) ?Selection {
|
||||
const root = self.buf_root() catch return null;
|
||||
return sel_.from_pos(root, self.metrics) catch null;
|
||||
}
|
||||
|
||||
fn count_lines(content: []const u8) struct { usize, usize } {
|
||||
var pos = content;
|
||||
var offset = content.len;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue