diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-08 12:44:41 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-08 12:44:41 +0200 |
| commit | 57b371d567d2d4f4f81ad6f3a242f231ecad91e6 (patch) | |
| tree | 3c1d9f940e444f76fcb6713fc58a72c900121bdb /src/command.zig | |
| parent | 180c2a8faab3438f30abda91eab109e84a029c6e (diff) | |
| download | river-57b371d567d2d4f4f81ad6f3a242f231ecad91e6.tar.gz river-57b371d567d2d4f4f81ad6f3a242f231ecad91e6.tar.xz | |
Add binding to toggle tag of focused view
Diffstat (limited to 'src/command.zig')
| -rw-r--r-- | src/command.zig | 12 |
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 { |
