-
Notifications
You must be signed in to change notification settings - Fork 331
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
Boolean option syntax change from set option/nooption/option!
to set option true/false/toggle
#758
Comments
I'm a vim user but I ran into this as well. Whatever way you go with this it would be helpful to mention the option syntax at the top of the options section. Or just link to syntax. Somewhat related:
will cause parsing issues (should be |
@laktak I don't remember considering multiline strings when implementing quotes. I don't know if it is working and if it is working I'm not aware if someone has a use case for it. It might be a good idea to report such cases. Also worth mentioning that single quotes can also be used in this case (i.e. |
@gokcehan I think my comment was too vague - |
I had given up on this proposal as I thought it was going to be too painful to change the syntax at this point. After some thought, I decided that we can instead keep both syntaxes at the same time without removing the old ones. So I have now pushed a commit to accept the following forms:
To be specific, first one was already working accidentally. The second one is the breaking change (i.e. it used to enable the option instead of disable). I haven't added anything new for toggling but only error handling. I don't think the original proposal was a good idea as it is a new invented syntax that we don't see users try by accident (i.e. |
I was bitten by this a few days ago. (with |
Our current boolean option syntax is borrowed from
vim
which is confusing for some users (see #742 as an example). I still see many users in the wild having things likeset hidden true
in their config files which only works accidentally (see Brodie Robertson's config). This issue is worsened by the fact that our parser silently accepting such inputs as the option syntax isset option value
in general. Having "on/off" for boolean default values in our documentation does not help this issue either. We could report such errors in our evaluator but it still feels like a band-aid solution.So I propose we simply change the syntax of boolean options as follows:
An example with
hidden
option:A few remarks on this change:
vim
. Also, rest of the option setting syntax do not followvim
conventions anyway (e.g. we don't haveset option=value
and the rest).ranger
also uses this syntax except for toggling.!echo $lf_hidden
already showstrue/false
).We should be able to implement this change with a deprecation strategy by allowing both syntaxes to coexists for a few releases with a deprecation warning for the old syntax.
The text was updated successfully, but these errors were encountered: