diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-03-25 16:35:33 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-03-25 16:35:33 +1100 |
| commit | 435b5b7ff97c7e52d50c002c9480af7066ead2ad (patch) | |
| tree | 0e5e9bbf0443e8078a56fde1b9cd620309f048f7 /src/keymap_manager.cc | |
| parent | 2d85e945167bb47fac5389172f190536352df8f1 (diff) | |
Unify code that validates identifiers in Kakoune
Session/Client/User modes names are now requiered to be "identifiers"
they must be in [a-zA-Z0-9_-]. Option names are the same except they
do not allow '-' as they need to be made available through the env vars
and '-' is not supported there.
Fixes #1946
Diffstat (limited to 'src/keymap_manager.cc')
| -rw-r--r-- | src/keymap_manager.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/keymap_manager.cc b/src/keymap_manager.cc index fd83757c..844f150f 100644 --- a/src/keymap_manager.cc +++ b/src/keymap_manager.cc @@ -61,7 +61,7 @@ void KeymapManager::add_user_mode(String user_mode_name) if (contains(user_modes(), user_mode_name)) throw runtime_error(format("user mode '{}' already defined", user_mode_name)); - if (contains_that(user_mode_name, is_blank)) + if (not all_of(user_mode_name, is_identifier)) throw runtime_error(format("invalid mode name: '{}'", user_mode_name)); user_modes().push_back(std::move(user_mode_name)); |
