configapi: Also allow mode as posarg
This commit is contained in:
parent
e8ae672c93
commit
248afde21e
@ -180,11 +180,11 @@ class ConfigAPI:
|
|||||||
with self._handle_error('setting', name):
|
with self._handle_error('setting', name):
|
||||||
self._config.set_obj(name, value)
|
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):
|
with self._handle_error('binding', key):
|
||||||
self._keyconfig.bind(key, command, mode=mode, force=force)
|
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):
|
with self._handle_error('unbinding', key):
|
||||||
self._keyconfig.unbind(key, mode=mode)
|
self._keyconfig.unbind(key, mode=mode)
|
||||||
|
|
||||||
|
@ -202,7 +202,6 @@ class TestConfigPy:
|
|||||||
])
|
])
|
||||||
def test_bind(self, confpy, line, mode):
|
def test_bind(self, confpy, line, mode):
|
||||||
confpy.write(line)
|
confpy.write(line)
|
||||||
configfiles.read_config_py(confpy.filename)
|
|
||||||
confpy.read()
|
confpy.read()
|
||||||
expected = {mode: {',a': 'message-info foo'}}
|
expected = {mode: {',a': 'message-info foo'}}
|
||||||
assert config.instance._values['bindings.commands'] == expected
|
assert config.instance._values['bindings.commands'] == expected
|
||||||
|
Loading…
Reference in New Issue
Block a user