mirror of
https://github.com/mawww/kakoune.git
synced 2024-09-11 13:00:41 +03:00
Require setting "key" type option to exactly 1 key
(following the example of "codepoint")
This commit is contained in:
parent
6ecf6bc06b
commit
862718d021
@ -81,8 +81,7 @@ are exclusively available to built-in options.
|
||||
|
||||
*key*::
|
||||
a single keypress using the same syntax as `map` (see
|
||||
<<mapping#mappable-keys,`:doc mapping mappable-keys`>>). If
|
||||
multiple keys are entered, only the first will be used.
|
||||
<<mapping#mappable-keys,`:doc mapping mappable-keys`>>)
|
||||
|
||||
*coord*::
|
||||
a line, column pair (separated by a comma)
|
||||
|
@ -229,8 +229,8 @@ String option_to_string(const Key& key)
|
||||
Key option_from_string(Meta::Type<Key>, StringView str)
|
||||
{
|
||||
auto keys = parse_keys(str);
|
||||
if (keys.empty())
|
||||
return Key(Key::Invalid);
|
||||
if (keys.size() != 1)
|
||||
throw runtime_error(format("'{}' is not a single key", str));
|
||||
|
||||
return keys.front();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user