feat: quit when closing last open split

This commit is contained in:
CJ van den Berg 2025-11-10 19:04:37 +01:00
parent 27bdd64f88
commit 407d5fa888
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 3 additions and 1 deletions

View file

@ -14,7 +14,7 @@
["ctrl+4", "focus_split", 3],
["ctrl+j", "toggle_panel"],
["ctrl+q", "quit"],
["ctrl+w", "quit"],
["ctrl+w", "close_split"],
["ctrl+o", "open_file"],
["ctrl+e", "open_recent"],
["alt+o", "open_previous_file"],

View file

@ -778,6 +778,8 @@ const cmds = struct {
pub const add_split_meta: Meta = .{ .description = "Add split view" };
pub fn close_split(self: *Self, _: Ctx) Result {
if (self.views.widgets.items.len == 1)
return command.executeName("quit", .{});
return self.remove_active_view();
}
pub const close_split_meta: Meta = .{ .description = "Close split view" };