feat: make mru file position lookup synchronous
This commit is contained in:
parent
5f7b28db5f
commit
2a76da6cf6
3 changed files with 16 additions and 7 deletions
|
@ -359,6 +359,12 @@ const cmds = struct {
|
|||
const same_file = if (self.get_active_file_path()) |fp| std.mem.eql(u8, fp, f) else false;
|
||||
const have_editor_metadata = if (self.buffer_manager.get_buffer_for_file(f)) |_| true else false;
|
||||
|
||||
if (!same_file and !have_editor_metadata)
|
||||
if (try project_manager.get_mru_position(self.allocator, f)) |pos| {
|
||||
line = @intCast(pos.row);
|
||||
column = @intCast(pos.col);
|
||||
};
|
||||
|
||||
if (!same_file) {
|
||||
if (self.get_active_editor()) |editor| {
|
||||
editor.send_editor_jump_source() catch {};
|
||||
|
@ -374,9 +380,6 @@ const cmds = struct {
|
|||
try command.executeName("scroll_view_center", .{});
|
||||
if (column) |col|
|
||||
try command.executeName("goto_column", command.fmt(.{col}));
|
||||
} else {
|
||||
if (!same_file and !have_editor_metadata)
|
||||
try project_manager.get_mru_position(f);
|
||||
}
|
||||
tui.need_render();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue