fix: abort navigate if there are unsaved changes
This commit is contained in:
parent
60bd6d85dd
commit
acabb20785
1 changed files with 2 additions and 0 deletions
|
@ -166,6 +166,8 @@ const cmds = struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn navigate(self: *Self, ctx: Ctx) tp.result {
|
pub fn navigate(self: *Self, ctx: Ctx) tp.result {
|
||||||
|
if (self.editor) |editor| if (editor.is_dirty())
|
||||||
|
return tp.exit("unsaved changes");
|
||||||
const frame = tracy.initZone(@src(), .{ .name = "navigate" });
|
const frame = tracy.initZone(@src(), .{ .name = "navigate" });
|
||||||
defer frame.deinit();
|
defer frame.deinit();
|
||||||
var file: ?[]const u8 = null;
|
var file: ?[]const u8 = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue