This commit is contained in:
Kovid Goyal 2018-12-29 08:08:24 +05:30
parent fd298256d7
commit 06c5127856
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -115,7 +115,7 @@ def float_parse(func, rest):
@func_with_args('change_font_size')
def parse_change_font_size(func, rest):
vals = rest.split(' ', 1)
vals = rest.strip().split(' ', 1)
if len(vals) != 2:
log_error('Invalid change_font_size specification: {}, treating it as default'.format(rest))
args = [True, None, 0]
@ -125,13 +125,13 @@ def parse_change_font_size(func, rest):
if amt[0] in '+-':
args[1] = amt[0]
amt = amt[1:]
args[2] = float(amt)
args[2] = float(amt.strip())
return func, args
@func_with_args('clear_terminal')
def clear_terminal(func, rest):
vals = rest.split(' ', 1)
vals = rest.strip().split(' ', 1)
if len(vals) != 2:
log_error('clear_terminal needs two arguments, using defaults')
args = ['reset', 'active']
@ -152,7 +152,7 @@ def neighboring_window(func, rest):
@func_with_args('resize_window')
def resize_window(func, rest):
vals = rest.split(' ', 1)
vals = rest.strip().split(' ', 1)
if len(vals) > 2:
log_error('resize_window needs one or two arguments, using defaults')
args = ['wider', 1]
@ -205,7 +205,7 @@ def nth_window(func, rest):
def parse_key_action(action):
parts = action.split(' ', 1)
parts = action.strip().split(' ', 1)
func = parts[0]
if len(parts) == 1:
return KeyAction(func, ())
@ -216,6 +216,7 @@ def parse_key_action(action):
func, args = parser(func, rest)
except Exception:
log_error('Ignoring invalid key action: {}'.format(action))
else:
return KeyAction(func, args)