From b1cf854ed4219f9027842bc3c9237460eeb53bea Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 14 Jan 2026 19:54:25 +0100 Subject: [PATCH] fix: location_update should use editor that generated the event --- src/tui/mainview.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index 4360507..ce5ea6e 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -1478,7 +1478,7 @@ pub fn handle_editor_event(self: *Self, editor: *ed.Editor, m: tp.message) tp.re var sel: ed.Selection = undefined; if (try m.match(.{ "E", "location", tp.more })) - return self.location_update(m); + return self.location_update(editor, m); if (try m.match(.{ "E", "close" })) { if (!self.closing_project) { @@ -1511,11 +1511,11 @@ pub fn handle_editor_event(self: *Self, editor: *ed.Editor, m: tp.message) tp.re } } -pub fn location_update(self: *Self, m: tp.message) tp.result { +pub fn location_update(self: *Self, editor: *ed.Editor, m: tp.message) tp.result { var row: usize = 0; var col: usize = 0; - const file_path = self.get_active_file_path() orelse return; - const ephemeral = if (self.get_active_buffer()) |buffer| buffer.is_ephemeral() else false; + const file_path = editor.file_path orelse return; + const ephemeral = if (editor.buffer) |buffer| buffer.is_ephemeral() else false; if (try m.match(.{ tp.any, tp.any, tp.any, tp.extract(&row), tp.extract(&col) })) { if (row == 0 and col == 0) return;