fix: abort navigate if there are unsaved changes

This commit is contained in:
CJ van den Berg 2024-03-27 21:11:47 +01:00
parent 60bd6d85dd
commit acabb20785

View file

@ -166,6 +166,8 @@ const cmds = struct {
}
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" });
defer frame.deinit();
var file: ?[]const u8 = null;