Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Lines with mixed commands and comments #3044

Closed
Alphare opened this issue Oct 31, 2018 · 5 comments
Closed

[Feature Request] Lines with mixed commands and comments #3044

Alphare opened this issue Oct 31, 2018 · 5 comments
Labels
enhancement New feature or incremental improvement

Comments

@Alphare
Copy link

Alphare commented Oct 31, 2018

  • Sway Version:

sway version 1.0-beta.1-106-g1c2a356d (Oct 28 2018, branch 'master')

  • Debug Log:
2018-10-31 20:01:05 - [sway/sway/config/input.c:150] Merging on top of existing input config
2018-10-31 20:01:05 - [sway/sway/config/input.c:173] Config stored for input *
2018-10-31 20:01:05 - [sway/sway/config.c:654] Read line 48: 
2018-10-31 20:01:05 - [sway/sway/config.c:654] Read line 49:     repeat_delay 200 # ms
2018-10-31 20:01:05 - [sway/sway/commands.c:374] handling config command 'input * repeat_delay 200 # ms'
2018-10-31 20:01:05 - [sway/sway/commands.c:156] find_handler(input)
2018-10-31 20:01:05 - [sway/sway/commands/input.c:47] entering input block: *
2018-10-31 20:01:05 - [sway/sway/config/input.c:14] new_input_config(*)
2018-10-31 20:01:05 - [sway/sway/commands.c:156] find_handler(repeat_delay)
2018-10-31 20:01:05 - [sway/sway/commands.c:409] Subcommand: repeat_delay 200 # ms
2018-10-31 20:01:05 - [sway/sway/commands.c:156] find_handler(repeat_delay)
2018-10-31 20:01:05 - [sway/sway/config.c:707] Error on line 49 'repeat_delay 200 # ms': Invalid repeat_delay command (expected 1 argument, got 3) (/home/alphare/.config/sway/config)
2018-10-31 20:01:05 - [sway/sway/config.c:654] Read line 50:     repeat_rate 5 # keys per second
2018-10-31 20:01:05 - [sway/sway/commands.c:374] handling config command 'input * repeat_rate 5 # keys per second'
2018-10-31 20:01:05 - [sway/sway/commands.c:156] find_handler(input)
2018-10-31 20:01:05 - [sway/sway/commands/input.c:47] entering input block: *
2018-10-31 20:01:05 - [sway/sway/config/input.c:14] new_input_config(*)
2018-10-31 20:01:05 - [sway/sway/commands.c:156] find_handler(repeat_rate)
2018-10-31 20:01:05 - [sway/sway/commands.c:409] Subcommand: repeat_rate 5 # keys per second
2018-10-31 20:01:05 - [sway/sway/commands.c:156] find_handler(repeat_rate)
2018-10-31 20:01:05 - [sway/sway/config.c:707] Error on line 50 'repeat_rate 5 # keys per second': Invalid repeat_rate command (expected 1 argument, got 5) (/home/alphare/.config/sway/config)
2018-10-31 20:01:05 - [sway/sway/config.c:654] Read line 51: }
2018-10-31 20:01:05 - [sway/sway/config.c:744] Exiting block 'input *'

  • Configuration File:
input * {
    xkb_layout fr
    xkb_variant ,nodeadkeys
    xkb_options grp:alt_shift_toggle
    pointer_accel -1

    repeat_delay 200 # ms
    repeat_rate 5 # keys per second
}

Hi,
While trying to change the repeat_delay and repeat_rate parameters of the input config, I get an error, which you can see in the traceback snippet.
Thanks

@RedSoxFan
Copy link
Member

Currently lines with mixed commands and comments are not supported

@RedSoxFan RedSoxFan changed the title Config errors on repeat_delay and repeat rate parameters [Feature Request] Lines with mixed commands and comments Oct 31, 2018
@emersion emersion added the enhancement New feature or incremental improvement label Oct 31, 2018
@ascent12
Copy link
Member

This unfortunately would make the config parser ambiguous, due to the fact that i3 decided to use #RRGGBB syntax for specifying colours.
There would require making a context-sensitive parser, which I'm sure nobody wants to do.

@RedSoxFan
Copy link
Member

This unfortunately would make the config parser ambiguous, due to the fact that i3 decided to use #RRGGBB syntax for specifying colours.
There would require making a context-sensitive parser, which I'm sure nobody wants to do.

I think a reasonable solution to that is to force a space before and after the #. This will isolate the # into it's own argument. For any case where a # in it's own argument may actually be desired, it could just be enclosed in quotes.

@RedSoxFan
Copy link
Member

It has been decided that this will not be implemented. If you would like to include comments for units (or anything else), please put them on their own line.

@Alphare
Copy link
Author

Alphare commented Nov 3, 2018

This indeed matches what i3 does. It's a little frustrating, but the argument about switching to a context-sensitive parser outweighs this minor inconvenience. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or incremental improvement
Development

Successfully merging a pull request may close this issue.

4 participants