feat: quit when closing last open split
This commit is contained in:
parent
27bdd64f88
commit
407d5fa888
2 changed files with 3 additions and 1 deletions
|
|
@ -14,7 +14,7 @@
|
||||||
["ctrl+4", "focus_split", 3],
|
["ctrl+4", "focus_split", 3],
|
||||||
["ctrl+j", "toggle_panel"],
|
["ctrl+j", "toggle_panel"],
|
||||||
["ctrl+q", "quit"],
|
["ctrl+q", "quit"],
|
||||||
["ctrl+w", "quit"],
|
["ctrl+w", "close_split"],
|
||||||
["ctrl+o", "open_file"],
|
["ctrl+o", "open_file"],
|
||||||
["ctrl+e", "open_recent"],
|
["ctrl+e", "open_recent"],
|
||||||
["alt+o", "open_previous_file"],
|
["alt+o", "open_previous_file"],
|
||||||
|
|
|
||||||
|
|
@ -778,6 +778,8 @@ const cmds = struct {
|
||||||
pub const add_split_meta: Meta = .{ .description = "Add split view" };
|
pub const add_split_meta: Meta = .{ .description = "Add split view" };
|
||||||
|
|
||||||
pub fn close_split(self: *Self, _: Ctx) Result {
|
pub fn close_split(self: *Self, _: Ctx) Result {
|
||||||
|
if (self.views.widgets.items.len == 1)
|
||||||
|
return command.executeName("quit", .{});
|
||||||
return self.remove_active_view();
|
return self.remove_active_view();
|
||||||
}
|
}
|
||||||
pub const close_split_meta: Meta = .{ .description = "Close split view" };
|
pub const close_split_meta: Meta = .{ .description = "Close split view" };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue