Properly fix zoom handling

This commit is contained in:
Florian Bruhin 2018-12-05 07:57:21 +01:00
parent 8a107fa5b3
commit 2770a935e9

View File

@ -76,16 +76,16 @@ def zoom(tab: apitypes.Tab,
count: The zoom percentage to set. count: The zoom percentage to set.
quiet: Don't show a zoom level message. quiet: Don't show a zoom level message.
""" """
if level is not None: if count is not None:
int_level = count
elif level is not None:
try: try:
int_level = int(level.rstrip('%')) int_level = int(level.rstrip('%'))
except ValueError: except ValueError:
raise cmdutils.CommandError("zoom: Invalid int value {}" raise cmdutils.CommandError("zoom: Invalid int value {}"
.format(level)) .format(level))
elif count is not None:
int_level = count
else: else:
int_level = config.val.zoom.default int_level = int(config.val.zoom.default)
try: try:
tab.zoom.set_factor(int_level / 100) tab.zoom.set_factor(int_level / 100)