From 180c2a8faab3438f30abda91eab109e84a029c6e Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 8 Apr 2020 00:40:41 +0200 Subject: Add binding to toggle focused tags --- src/command.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/command.zig') 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; -- cgit v1.2.3