From d5d23834f6e35d5dfcfbf99cc59fc9c9db6991e4 Mon Sep 17 00:00:00 2001 From: Delapouite Date: Sun, 11 Mar 2018 14:58:07 +0100 Subject: [PATCH] Handle hyphens in user-mode names Fix #1921 --- src/keymap_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/keymap_manager.cc b/src/keymap_manager.cc index 658c7e426..fd83757cc 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, [](char c){ return not isalnum(c); })) + if (contains_that(user_mode_name, is_blank)) throw runtime_error(format("invalid mode name: '{}'", user_mode_name)); user_modes().push_back(std::move(user_mode_name));