aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/workspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/workspace.c')
-rw-r--r--sway/commands/workspace.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index f32ede1e..f5558bb4 100644
--- a/sway/commands/workspace.c
+++ b/sway/commands/workspace.c
@@ -68,16 +68,20 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
68 ws = workspace_create(NULL, name); 68 ws = workspace_create(NULL, name);
69 free(name); 69 free(name);
70 } 70 }
71 } else if (strcasecmp(argv[0], "next") == 0 ||
72 strcasecmp(argv[0], "prev") == 0 ||
73 strcasecmp(argv[0], "next_on_output") == 0 ||
74 strcasecmp(argv[0], "prev_on_output") == 0 ||
75 strcasecmp(argv[0], "current") == 0) {
76 ws = workspace_by_name(argv[0]);
77 } else if (strcasecmp(argv[0], "back_and_forth") == 0) {
78 if (!(ws = workspace_by_name(argv[0])) && prev_workspace_name) {
79 ws = workspace_create(NULL, prev_workspace_name);
80 }
71 } else { 81 } else {
72 char *name = join_args(argv, argc); 82 char *name = join_args(argv, argc);
73 if (!(ws = workspace_by_name(name))) { 83 if (!(ws = workspace_by_name(name))) {
74 if (strcasecmp(argv[0], "back_and_forth") == 0) { 84 ws = workspace_create(NULL, name);
75 if (prev_workspace_name) {
76 ws = workspace_create(NULL, prev_workspace_name);
77 }
78 } else {
79 ws = workspace_create(NULL, name);
80 }
81 } 85 }
82 free(name); 86 free(name);
83 } 87 }