From: Michael Stapelberg Date: Thu, 27 Oct 2011 22:27:33 +0000 (+0100) Subject: Error out early if there is nothing to move X-Git-Tag: 4.1~36 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8e3cef33d9d33dadaa75dc20a06de242471612f0;p=i3%2Fi3 Error out early if there is nothing to move Fixes: #532 --- diff --git a/src/cmdparse.y b/src/cmdparse.y index 0144524b..a1fb0473 100644 --- a/src/cmdparse.y +++ b/src/cmdparse.y @@ -762,6 +762,11 @@ move: { owindow *current; + /* Error out early to not create a non-existing workspace (in + * workspace_get()) if we are not actually able to move anything. */ + if (match_is_empty(¤t_match) && focused->type == CT_WORKSPACE) + break; + printf("should move window to workspace %s\n", $3); /* get the workspace */ Con *ws = workspace_get($3, NULL);