Fix exception on ":set -p foo bar!".

This commit is contained in:
Florian Bruhin 2015-08-04 23:50:43 +02:00
parent d59fa24fd5
commit 15e854237e

View File

@ -674,10 +674,11 @@ class ConfigManager(QObject):
else: else:
try: try:
if option.endswith('!') and value is None: if option.endswith('!') and value is None:
val = self.get(section_, option[:-1]) option = option[:-1]
val = self.get(section_, option)
layer = 'temp' if temp else 'conf' layer = 'temp' if temp else 'conf'
if isinstance(val, bool): if isinstance(val, bool):
self.set(layer, section_, option[:-1], str(not val)) self.set(layer, section_, option, str(not val))
else: else:
raise cmdexc.CommandError( raise cmdexc.CommandError(
"set: Attempted inversion of non-boolean value.") "set: Attempted inversion of non-boolean value.")