diff options
author | 2018-10-25 12:58:05 -0400 | |
---|---|---|
committer | 2018-11-10 21:53:10 -0500 | |
commit | b27700060196cb41df1180f51a3d7a254a97fd27 (patch) | |
tree | ce2f52dfe9b7c1b69df89aad8e6680e00be35b72 /.editorconfig | |
parent | Merge pull request #3098 from c-edw/feature/RefactorArgParse (diff) | |
download | sway-b27700060196cb41df1180f51a3d7a254a97fd27.tar.gz sway-b27700060196cb41df1180f51a3d7a254a97fd27.tar.zst sway-b27700060196cb41df1180f51a3d7a254a97fd27.zip |
Alter config variable replacement process
Currently, variables cannot contain commands and cannot span more than
one argument. This is due to variable replacement happening after
determining the handler and after splitting the config line into
arguments.
This changes the process to:
0. Check for empty lines and block boundaries
1. Split the arguments as before
2. Verify that the first argument is not a variable. If needed the
following occurs
a. Perform variable replacement on just the first argument
b. Join the arguments back together then split the arguments again. This is needed when the variable
contains the command and arguments for the command.
3. Determine the handler
4. If the handler is cmd_set, escape the variable name so that it does
not get replaced
5. Join the arguments back together, do variable replacement on the full
command, and split the arguments again
6. Perform any needed quote stripping or unescaping on arguments
7. Run the command handler
This allows for config snippets such as:
```
set $super bindsym Mod4
$super+a exec some-command
```
and
```
set $bg bg #ffffff solid_color
output * $bg
```
Diffstat (limited to '.editorconfig')
0 files changed, 0 insertions, 0 deletions