aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 177c54ab..6e74a442 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -822,11 +822,8 @@ static bool cmd_workspace(struct sway_config *config, int argc, char **argv) {
822 } 822 }
823 if (strcasecmp(argv[0], "back_and_forth") == 0) { 823 if (strcasecmp(argv[0], "back_and_forth") == 0) {
824 if (prev_workspace_name) { 824 if (prev_workspace_name) {
825 if (workspace_by_name(prev_workspace_name)) { 825 swayc_t *ws = workspace_by_name(prev_workspace_name);
826 workspace_switch(workspace_by_name(prev_workspace_name)); 826 workspace_switch(ws ? ws : workspace_create(prev_workspace_name));
827 } else {
828 workspace_switch(workspace_create(prev_workspace_name));
829 }
830 } 827 }
831 return true; 828 return true;
832 } 829 }