mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-18 17:02:06 +03:00
parent
01259bf22c
commit
f3c19ba7fa
@ -842,6 +842,9 @@ void define_command(const ParametersParser& parser, Context& context, const Shel
|
|||||||
const String& cmd_name = parser[0];
|
const String& cmd_name = parser[0];
|
||||||
auto& cm = CommandManager::instance();
|
auto& cm = CommandManager::instance();
|
||||||
|
|
||||||
|
if (contains_that(cmd_name, is_blank))
|
||||||
|
throw runtime_error(format("invalid command name: '{}'", cmd_name));
|
||||||
|
|
||||||
if (cm.command_defined(cmd_name) and not parser.get_switch("allow-override"))
|
if (cm.command_defined(cmd_name) and not parser.get_switch("allow-override"))
|
||||||
throw runtime_error(format("command '{}' already defined", cmd_name));
|
throw runtime_error(format("command '{}' already defined", cmd_name));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user