Set zoom to default instead of 100% with :zoom/=.

This commit is contained in:
Florian Bruhin 2014-12-22 18:04:28 +01:00
parent f50a19a488
commit b01041e455
2 changed files with 4 additions and 3 deletions

View File

@ -508,7 +508,7 @@ Syntax: +:zoom ['zoom']+
Set the zoom level for the current tab.
The zoom can be given as argument or as [count]. If neither of both is given, the zoom is set to 100%.
The zoom can be given as argument or as [count]. If neither of both is given, the zoom is set to the default zoom.
==== positional arguments
* +'zoom'+: The zoom percentage to set.

View File

@ -619,14 +619,15 @@ class CommandDispatcher:
"""Set the zoom level for the current tab.
The zoom can be given as argument or as [count]. If neither of both is
given, the zoom is set to 100%.
given, the zoom is set to the default zoom.
Args:
zoom: The zoom percentage to set.
count: The zoom percentage to set.
"""
try:
level = cmdutils.arg_or_count(zoom, count, default=100)
default = config.get('ui', 'default-zoom')
level = cmdutils.arg_or_count(zoom, count, default=default)
except ValueError as e:
raise cmdexc.CommandError(e)
tab = self._current_widget()