aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mapping.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-05 09:50:36 +0800
committerGitHub <noreply@github.com>2023-05-05 09:50:36 +0800
commit9ded4c127599b821d0875db9d63049b5970437a4 (patch)
tree04ab960fec3aaaf6d139164e27ee8c4c6ff8f900 /src/nvim/mapping.c
parentd79e72621226cae91c8d8f6ad23e3c0670e1211c (diff)
parentbdaaf2e8e113f8c32c70f83b60e0bf3f648357c1 (diff)
downloadrneovim-9ded4c127599b821d0875db9d63049b5970437a4.tar.gz
rneovim-9ded4c127599b821d0875db9d63049b5970437a4.tar.bz2
rneovim-9ded4c127599b821d0875db9d63049b5970437a4.zip
Merge pull request #23483 from zeertzjq/vim-8.2.3135
vim-patch:8.2.{3135,4890,4892},9.0.0250: error message improvements
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r--src/nvim/mapping.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index c1d02e89b8..c5449bd66e 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -65,6 +65,17 @@ static mapblock_T *(maphash[MAX_MAPHASH]) = { 0 };
# include "mapping.c.generated.h"
#endif
+static const char e_global_abbreviation_already_exists_for_str[]
+ = N_("E224: Global abbreviation already exists for %s");
+static const char e_global_mapping_already_exists_for_str[]
+ = N_("E225: Global mapping already exists for %s");
+static const char e_abbreviation_already_exists_for_str[]
+ = N_("E226: Abbreviation already exists for %s");
+static const char e_mapping_already_exists_for_str[]
+ = N_("E227: Mapping already exists for %s");
+static const char e_entries_missing_in_mapset_dict_argument[]
+ = N_("E460: Entries missing in mapset() dict argument");
+
/// Get the start of the hashed map list for "state" and first character "c".
mapblock_T *get_maphash_list(int state, int c)
{
@@ -645,10 +656,9 @@ static int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev,
&& mp->m_keylen == len
&& strncmp(mp->m_keys, lhs, (size_t)len) == 0) {
if (is_abbrev) {
- semsg(_("E224: global abbreviation already exists for %s"),
- mp->m_keys);
+ semsg(_(e_global_abbreviation_already_exists_for_str), mp->m_keys);
} else {
- semsg(_("E225: global mapping already exists for %s"), mp->m_keys);
+ semsg(_(e_global_mapping_already_exists_for_str), mp->m_keys);
}
retval = 5;
goto theend;
@@ -761,9 +771,9 @@ static int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev,
break;
} else if (args->unique) {
if (is_abbrev) {
- semsg(_("E226: abbreviation already exists for %s"), p);
+ semsg(_(e_abbreviation_already_exists_for_str), p);
} else {
- semsg(_("E227: mapping already exists for %s"), p);
+ semsg(_(e_mapping_already_exists_for_str), p);
}
retval = 5;
goto theend;
@@ -2226,7 +2236,7 @@ void f_mapset(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
api_free_object(callback_obj);
}
if (lhs == NULL || lhsraw == NULL || orig_rhs == NULL) {
- emsg(_("E460: entries missing in mapset() dict argument"));
+ emsg(_(e_entries_missing_in_mapset_dict_argument));
api_free_luaref(rhs_lua);
return;
}