aboutsummaryrefslogtreecommitdiff
path: root/src/command.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.zig')
-rw-r--r--src/command.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/command.zig b/src/command.zig
index 075e21f..add31ea 100644
--- a/src/command.zig
+++ b/src/command.zig
@@ -92,6 +92,18 @@ pub fn setFocusedViewTags(server: *Server, arg: Arg) void {
}
}
+/// Toggle the passed tags of the focused view
+pub fn toggleFocusedViewTags(server: *Server, arg: Arg) void {
+ const tags = arg.uint;
+ if (server.root.focused_view) |view| {
+ const new_tags = view.current_tags ^ tags;
+ if (new_tags != 0) {
+ view.pending_tags = new_tags;
+ server.root.arrange();
+ }
+ }
+}
+
/// Spawn a program.
/// TODO: make this take a program as a paramter and spawn that
pub fn spawn(server: *Server, arg: Arg) void {