fix: set project correctly on restart
This commit is contained in:
parent
bd62dfcdc1
commit
d0de867d91
2 changed files with 5 additions and 1 deletions
|
@ -453,7 +453,8 @@ pub const Editor = struct {
|
||||||
else
|
else
|
||||||
syntax.create_guess_file_type(self.allocator, content.items, self.file_path) catch null;
|
syntax.create_guess_file_type(self.allocator, content.items, self.file_path) catch null;
|
||||||
if (syn) |syn_|
|
if (syn) |syn_|
|
||||||
project_manager.did_open(file_path, syn_.file_type, self.lsp_version, try content.toOwnedSlice()) catch {};
|
project_manager.did_open(file_path, syn_.file_type, self.lsp_version, try content.toOwnedSlice()) catch |e|
|
||||||
|
self.logger.print("project_manager.did_open failed: {any}", .{e});
|
||||||
break :syntax syn;
|
break :syntax syn;
|
||||||
};
|
};
|
||||||
self.syntax_no_render = tp.env.get().is("no-syntax");
|
self.syntax_no_render = tp.env.get().is("no-syntax");
|
||||||
|
|
|
@ -363,6 +363,9 @@ const cmds = struct {
|
||||||
pub const open_config_meta = .{ .description = "Edit configuration file" };
|
pub const open_config_meta = .{ .description = "Edit configuration file" };
|
||||||
|
|
||||||
pub fn restore_session(self: *Self, _: Ctx) Result {
|
pub fn restore_session(self: *Self, _: Ctx) Result {
|
||||||
|
if (tp.env.get().str("project").len == 0) {
|
||||||
|
try open_project_cwd(self, .{});
|
||||||
|
}
|
||||||
try self.create_editor();
|
try self.create_editor();
|
||||||
try self.read_restore_info();
|
try self.read_restore_info();
|
||||||
tui.need_render();
|
tui.need_render();
|
||||||
|
|
Loading…
Add table
Reference in a new issue