diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index c8579dd..131e558 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -1718,10 +1718,10 @@ fn extract_state(self: *Self, iter: *[]const u8) !void { send_buffer_did_open(self.allocator, buffer) catch {}; if (editor_file_path) |file_path| { - try tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_path } }); - } else { - try tp.self_pid().send(.{ "cmd", "close_file" }); + if (self.buffer_manager.get_buffer_for_file(file_path)) |_| + return tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_path } }); } + try tp.self_pid().send(.{ "cmd", "close_file" }); } fn send_buffer_did_open(allocator: std.mem.Allocator, buffer: *Buffer) !void {