]> git.sur5r.net Git - i3/i3/blobdiff - generate-command-parser.pl
Bugfix: Properly parse commands like “move workspace torrent” (Thanks rasi)
[i3/i3] / generate-command-parser.pl
index 5cdebf343c9dcb9794fd2c8e7930435ca3fc6dc7..b76d5e5512f8215ffec637103c8c9686c7dc97ef 100755 (executable)
@@ -84,14 +84,14 @@ for my $line (@lines) {
         # Cleanup the identifier (if any).
         $identifier =~ s/^\s*(\S+)\s*=\s*$/$1/g;
 
-        # Cleanup the tokens (remove whitespace).
-        $tokens =~ s/\s*//g;
-
         # The default action is to stay in the current state.
         $action = $current_state if length($action) == 0;
 
         #say "identifier = *$identifier*, token = *$tokens*, action = *$action*";
         for my $token (split(',', $tokens)) {
+            # Cleanup trailing/leading whitespace.
+            $token =~ s/^\s*//g;
+            $token =~ s/\s*$//g;
             my $store_token = {
                 token => $token,
                 identifier => $identifier,