fix: navigate to editor_file_path only if it's buffer was restored
This commit is contained in:
parent
c8840f0756
commit
741096cb43
1 changed files with 3 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue