]> git.sur5r.net Git - i3/i3/commitdiff
lexer: Implement workspace <number> "<name>"
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 19 Sep 2009 17:39:06 +0000 (19:39 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 19 Sep 2009 17:39:06 +0000 (19:39 +0200)
src/cfgparse.y

index 4b7224b51ae1a8fc31e4a3c2edc17854314520da..7875f86ebaff72ce4335c87aaaf732cb1ace17c5 100644 (file)
@@ -257,6 +257,16 @@ workspace:
                                 workspace_set_name(&(workspaces[ws_num - 1]), $<string>8);
                 }
         }
+       | TOKWORKSPACE WHITESPACE NUMBER workspace_name
+       {
+                int ws_num = $<number>3;
+                if (ws_num < 1 || ws_num > 10) {
+                        LOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
+                } else {
+                       if ($<string>4 != NULL)
+                                       workspace_set_name(&(workspaces[ws_num - 1]), $<string>4);
+               }
+       }
         ;
 
 workspace_name: