Adjust :unbind signature to match :bind

This commit is contained in:
Florian Bruhin 2017-09-12 15:11:16 +02:00
parent f70c5968a9
commit b04a233e8d
3 changed files with 6 additions and 4 deletions

View File

@ -933,13 +933,15 @@ How many tabs to switch back.
[[unbind]]
=== unbind
Syntax: +:unbind 'key' ['mode']+
Syntax: +:unbind [*--mode* 'mode'] 'key'+
Unbind a keychain.
==== positional arguments
* +'key'+: The keychain or special key (inside <...>) to unbind.
* +'mode'+: A mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes.
==== optional arguments
* +*-m*+, +*--mode*+: A mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes.
[[undo]]

View File

@ -347,7 +347,7 @@ class ConfigCommands:
raise cmdexc.CommandError("bind: {}".format(e))
@cmdutils.register(instance='config-commands')
def unbind(self, key, mode='normal'):
def unbind(self, key, *, mode='normal'):
"""Unbind a keychain.
Args:

View File

@ -572,7 +572,7 @@ class TestBindConfigCommand:
Should show an error.
"""
with pytest.raises(cmdexc.CommandError, match=expected):
commands.unbind(key, mode)
commands.unbind(key, mode=mode)
class TestConfig: