diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
commit | f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d (patch) | |
tree | a6b07005c19279a4f5d01be14f14861c2657fa95 /src/if_ruby.c | |
parent | 05500ece6282407f9f7227aaf564e24147326863 (diff) | |
download | vim-git-f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d.tar.gz |
patch 8.1.0743: giving error messages is not flexiblev8.1.0743
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
#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r-- | src/if_ruby.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c index dc5511eaa..fb1b25b5e 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -745,7 +745,7 @@ ruby_runtime_link_init(char *libname, int verbose) if (!hinstRuby) { if (verbose) - EMSG2(_(e_loadlib), libname); + semsg(_(e_loadlib), libname); return FAIL; } @@ -757,7 +757,7 @@ ruby_runtime_link_init(char *libname, int verbose) close_dll(hinstRuby); hinstRuby = NULL; if (verbose) - EMSG2(_(e_loadfunc), ruby_funcname_table[i].name); + semsg(_(e_loadfunc), ruby_funcname_table[i].name); return FAIL; } } @@ -885,7 +885,7 @@ void ex_rubydo(exarg_T *eap) { if (TYPE(line) != T_STRING) { - EMSG(_("E265: $_ must be an instance of String")); + emsg(_("E265: $_ must be an instance of String")); return; } ml_replace(i, (char_u *) StringValuePtr(line), 1); @@ -979,7 +979,7 @@ static int ensure_ruby_initialized(void) } else { - EMSG(_("E266: Sorry, this command is disabled, the Ruby library could not be loaded.")); + emsg(_("E266: Sorry, this command is disabled, the Ruby library could not be loaded.")); return 0; } #endif @@ -1013,19 +1013,19 @@ static void error_print(int state) switch (state) { case TAG_RETURN: - EMSG(_("E267: unexpected return")); + emsg(_("E267: unexpected return")); break; case TAG_NEXT: - EMSG(_("E268: unexpected next")); + emsg(_("E268: unexpected next")); break; case TAG_BREAK: - EMSG(_("E269: unexpected break")); + emsg(_("E269: unexpected break")); break; case TAG_REDO: - EMSG(_("E270: unexpected redo")); + emsg(_("E270: unexpected redo")); break; case TAG_RETRY: - EMSG(_("E271: retry outside of rescue clause")); + emsg(_("E271: retry outside of rescue clause")); break; case TAG_RAISE: case TAG_FATAL: @@ -1038,7 +1038,7 @@ static void error_print(int state) einfo = rb_obj_as_string(error); if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) { - EMSG(_("E272: unhandled exception")); + emsg(_("E272: unhandled exception")); } else { @@ -1050,7 +1050,7 @@ static void error_print(int state) RSTRING_PTR(epath), RSTRING_PTR(einfo)); p = strchr(buff, '\n'); if (p) *p = '\0'; - EMSG(buff); + emsg(buff); } attr = syn_name2attr((char_u *)"Error"); @@ -1066,7 +1066,7 @@ static void error_print(int state) break; default: vim_snprintf(buff, BUFSIZ, _("E273: unknown longjmp status %d"), state); - EMSG(buff); + emsg(buff); break; } } |