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

Fix toggle config using capitalised boolean value. #1562

Merged
merged 2 commits into from
Jun 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qutebrowser/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ def set_command(self, win_id, section_=None, option=None, value=None,
val = self.get(section_, option)
layer = 'temp' if temp else 'conf'
if isinstance(val, bool):
self.set(layer, section_, option, str(not val))
self.set(layer, section_, option, str(not val).lower())
else:
raise cmdexc.CommandError(
"set: Attempted inversion of non-boolean value.")
Expand Down
4 changes: 2 additions & 2 deletions tests/end2end/features/set.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Setting settings.
Scenario: Toggling an option
When I run :set general auto-save-config false
And I run :set general auto-save-config!
Then general -> auto-save-config should be True
Then general -> auto-save-config should be true

Scenario: Toggling a non-bool option
When I run :set colors statusbar.bg!
Expand All @@ -44,7 +44,7 @@ Feature: Setting settings.
Scenario: Using ! and -p
When I run :set general auto-save-config false
And I run :set -p general auto-save-config!
Then the message "general auto-save-config = True" should be shown
Then the message "general auto-save-config = true" should be shown

Scenario: Setting an invalid value
When I run :set general auto-save-config blah
Expand Down