aboutsummaryrefslogtreecommitdiff
path: root/src/command.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.zig')
-rw-r--r--src/command.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/command.zig b/src/command.zig
index add31ea..7aac7f6 100644
--- a/src/command.zig
+++ b/src/command.zig
@@ -111,3 +111,10 @@ pub fn spawn(server: *Server, arg: Arg) void {
const child = std.ChildProcess.init(&argv, std.heap.c_allocator) catch unreachable;
std.ChildProcess.spawn(child) catch unreachable;
}
+
+/// Close the focused view, if any.
+pub fn close(server: *Server, arg: Arg) void {
+ if (server.root.focused_view) |view| {
+ view.close();
+ }
+}