From efa924f66b183d9cf2404ce91c4f009c27e0515a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 18 Oct 2021 09:08:46 -0400 Subject: vim-patch:8.1.0743: giving error messages is not flexible Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d --- src/nvim/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/keymap.c') diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index b724d82f7c..fc2f9b04f5 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -647,7 +647,7 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp, } else if (end - bp > 4 && STRNICMP(bp, "char-", 5) == 0) { vim_str2nr(bp + 5, NULL, &l, STR2NR_ALL, NULL, NULL, 0, true); if (l == 0) { - EMSG(_(e_invarg)); + emsg(_(e_invarg)); return 0; } bp += l + 5; @@ -677,7 +677,7 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp, // or or vim_str2nr(last_dash + 6, NULL, &l, STR2NR_ALL, NULL, &n, 0, true); if (l == 0) { - EMSG(_(e_invarg)); + emsg(_(e_invarg)); return 0; } key = (int)n; @@ -891,7 +891,7 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len, char_u **bu // (room: 5 * 6 = 30 bytes; needed: 3 + + 1 <= 14) if (end - src >= 4 && STRNICMP(src, "", 5) == 0) { if (current_sctx.sc_sid <= 0) { - EMSG(_(e_usingsid)); + emsg(_(e_usingsid)); } else { src += 5; result[dlen++] = K_SPECIAL; -- cgit