refactor: remove obsolete Editor.selection_pos_to_width function
This commit is contained in:
parent
f71f984dcd
commit
34af852634
2 changed files with 1 additions and 6 deletions
|
|
@ -5886,11 +5886,6 @@ 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 } {
|
fn count_lines(content: []const u8) struct { usize, usize } {
|
||||||
var pos = content;
|
var pos = content;
|
||||||
var offset = content.len;
|
var offset = content.len;
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ const Position = struct { line: usize, character: usize };
|
||||||
|
|
||||||
fn get_replace_selection(replace: Buffer.Selection) ?Buffer.Selection {
|
fn get_replace_selection(replace: Buffer.Selection) ?Buffer.Selection {
|
||||||
return if (tui.get_active_editor()) |edt|
|
return if (tui.get_active_editor()) |edt|
|
||||||
edt.selection_pos_to_width(replace)
|
replace.from_pos(edt.buf_root() catch return null, edt.metrics)
|
||||||
else if (replace.empty())
|
else if (replace.empty())
|
||||||
null
|
null
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue