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

Ability to toggle settings #47

Closed
1 of 4 tasks
The-Compiler opened this issue Oct 1, 2014 · 4 comments
Closed
1 of 4 tasks

Ability to toggle settings #47

The-Compiler opened this issue Oct 1, 2014 · 4 comments
Labels
easy Issues which are likely to be a good fit for first-time contributors. priority: 1 - middle Issues which should be done at some point, but aren't that important.

Comments

@The-Compiler
Copy link
Member

The-Compiler commented Oct 1, 2014

Some ideas:

  • :set --cycle to cycle setting between multiple values - for example, you could bind a key to :set --cycle tabs position right top.
  • Maybe also some special PREVIOUS value which goes back to the previous state.
  • bool settings toggleable with :set sect opt!
  • When saving last state (see bullet 2) we could also toggle between "false-value" and "last truth-y value" for settings which are nearly boolean (several true but one false state)
@The-Compiler The-Compiler self-assigned this Oct 1, 2014
@The-Compiler The-Compiler added the easy Issues which are likely to be a good fit for first-time contributors. label Oct 1, 2014
@The-Compiler The-Compiler added the priority: 1 - middle Issues which should be done at some point, but aren't that important. label Oct 1, 2015
@The-Compiler The-Compiler removed their assignment Oct 1, 2015
haasn added a commit to haasn/qutebrowser that referenced this issue Aug 11, 2016
Chooses the next value from the provided list of values (string-wise
comparison). Technically, the 'option!' syntax for toggling bools is now
redundant, but a translation from 'option!' to '--cycle option false
true' is kept for backwards compatibility.

The '--cycle' flag could also be technically optionally, since the only
thing that depends on it is preserving the error message for specifying
multiple values. (But I think it's best to keep it explicit, as a
principle-of-least-surprise thing)

Fixes qutebrowser#47
haasn added a commit to haasn/qutebrowser that referenced this issue Aug 11, 2016
Chooses the next value from the provided list of values (string-wise
comparison). Technically, the 'option!' syntax for toggling bools is now
redundant, but a translation from 'option!' to '--cycle option false
true' is kept for backwards compatibility.

The '--cycle' flag could also be technically optionally, since the only
thing that depends on it is preserving the error message for specifying
multiple values. (But I think it's best to keep it explicit, as a
principle-of-least-surprise thing)

Note: The business logic of picking the next value and setting it was
moved out to a separate function to avoid tripping pylint's
too-many-branches detector.

Fixes qutebrowser#47
@haasn
Copy link
Contributor

haasn commented Aug 11, 2016

Oops, I'm very sorry about “stealing” this - I completely missed the “work in progress” label.

haasn added a commit to haasn/qutebrowser that referenced this issue Aug 11, 2016
Chooses the next value from the provided list of values (string-wise
comparison). Technically, the 'option!' syntax for toggling bools is now
redundant, but a translation from 'option!' to '--cycle option false
true' is kept for backwards compatibility.

The '--cycle' flag could also be technically optionally, since the only
thing that depends on it is preserving the error message for specifying
multiple values. (But I think it's best to keep it explicit, as a
principle-of-least-surprise thing)

Note: The business logic of picking the next value and setting it was
moved out to a separate function to avoid tripping pylint's
too-many-branches detector.

Fixes qutebrowser#47
@m2habert
Copy link

¿Too late to add an idea? I've thought of

:set foo bar {toggle}

@The-Compiler
Copy link
Member Author

To toggle boolean values, there's :set foo bar! already - no point in adding a different bikeshed color syntax now 😉

@m2habert
Copy link

... and ! it's obviously more "vimish". Sorry, totally forgot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Issues which are likely to be a good fit for first-time contributors. priority: 1 - middle Issues which should be done at some point, but aren't that important.
Projects
None yet
Development

No branches or pull requests

3 participants