From 34af8526348788c2fb7ebc4300f0a4d835d06979 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 25 Nov 2025 13:30:28 +0100 Subject: [PATCH] refactor: remove obsolete Editor.selection_pos_to_width function --- src/tui/editor.zig | 5 ----- src/tui/mode/overlay/completion_palette.zig | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index f114b21..94a6d73 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -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 } { var pos = content; var offset = content.len; diff --git a/src/tui/mode/overlay/completion_palette.zig b/src/tui/mode/overlay/completion_palette.zig index d345315..8db07a0 100644 --- a/src/tui/mode/overlay/completion_palette.zig +++ b/src/tui/mode/overlay/completion_palette.zig @@ -139,7 +139,7 @@ const Position = struct { line: usize, character: usize }; fn get_replace_selection(replace: Buffer.Selection) ?Buffer.Selection { 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()) null else