configapi: Also allow mode as posarg

This commit is contained in:
Florian Bruhin 2017-09-19 13:18:44 +02:00
parent e8ae672c93
commit 248afde21e
2 changed files with 2 additions and 3 deletions

View File

@ -180,11 +180,11 @@ class ConfigAPI:
with self._handle_error('setting', name):
self._config.set_obj(name, value)
def bind(self, key, command, *, mode='normal', force=False):
def bind(self, key, command, mode='normal', *, force=False):
with self._handle_error('binding', key):
self._keyconfig.bind(key, command, mode=mode, force=force)
def unbind(self, key, *, mode='normal'):
def unbind(self, key, mode='normal'):
with self._handle_error('unbinding', key):
self._keyconfig.unbind(key, mode=mode)

View File

@ -202,7 +202,6 @@ class TestConfigPy:
])
def test_bind(self, confpy, line, mode):
confpy.write(line)
configfiles.read_config_py(confpy.filename)
confpy.read()
expected = {mode: {',a': 'message-info foo'}}
assert config.instance._values['bindings.commands'] == expected