mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
API/nvim_set_keymap: remove mode-shortname aliases
Reduce the API surface-area a bit. No need to have aliases for a mode. ref #9924
This commit is contained in:
@@ -797,15 +797,14 @@ void modify_keymap(Buffer buffer, bool is_unmap, String mode, String lhs,
|
||||
mode_val = get_map_mode(&p, true); // mapmode-ic
|
||||
} else {
|
||||
mode_val = get_map_mode(&p, false);
|
||||
if (mode_val == VISUAL + SELECTMODE + NORMAL + OP_PENDING) {
|
||||
// get_map_mode will treat "unrecognized" mode shortnames like "map"
|
||||
// if it does, and the given shortname wasn't "m" or " ", then error
|
||||
if (STRNCMP(p, "m", 2) && STRNCMP(p, " ", 2)) {
|
||||
err_msg = "Invalid mode shortname: %s";
|
||||
err_arg = (char *)p;
|
||||
err_type = kErrorTypeValidation;
|
||||
goto fail_with_message;
|
||||
}
|
||||
if ((mode_val == VISUAL + SELECTMODE + NORMAL + OP_PENDING)
|
||||
&& mode.size > 0) {
|
||||
// get_map_mode() treats unrecognized mode shortnames as ":map".
|
||||
// This is an error unless the given shortname was empty string "".
|
||||
err_msg = "Invalid mode shortname: \"%s\"";
|
||||
err_arg = (char *)p;
|
||||
err_type = kErrorTypeValidation;
|
||||
goto fail_with_message;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user