aboutsummaryrefslogtreecommitdiff
path: root/src/command.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-04-08 00:40:41 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-04-08 00:40:41 +0200
commit180c2a8faab3438f30abda91eab109e84a029c6e (patch)
treeba75a41d10bcff4d7f2ba824e606085191507f20 /src/command.zig
parentfa653337897b327a62b25840bea1713c262f45a6 (diff)
downloadriver-180c2a8faab3438f30abda91eab109e84a029c6e.tar.gz
river-180c2a8faab3438f30abda91eab109e84a029c6e.tar.xz
Add binding to toggle focused tags
Diffstat (limited to 'src/command.zig')
-rw-r--r--src/command.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/command.zig b/src/command.zig
index a325fe9..075e21f 100644
--- a/src/command.zig
+++ b/src/command.zig
@@ -71,6 +71,16 @@ pub fn focusTags(server: *Server, arg: Arg) void {
server.root.arrange();
}
+/// Toggle focus of the passsed tags.
+pub fn toggleTags(server: *Server, arg: Arg) void {
+ const tags = arg.uint;
+ const new_focused_tags = server.root.current_focused_tags ^ tags;
+ if (new_focused_tags != 0) {
+ server.root.pending_focused_tags = new_focused_tags;
+ server.root.arrange();
+ }
+}
+
/// Set the tags of the focused view.
pub fn setFocusedViewTags(server: *Server, arg: Arg) void {
const tags = arg.uint;