aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-06-03 09:34:23 +0900
committererw7 <erw7.github@gmail.com>2019-06-09 13:28:10 +0900
commitf66ffc64f611cae52df50df0e495b6ef08594e50 (patch)
tree9f99ec05566c3ceaf80978b708a7e99bd130cfe8
parent6fad1736fbe369d92afd88fb14ef637366bc5e77 (diff)
downloadrneovim-f66ffc64f611cae52df50df0e495b6ef08594e50.tar.gz
rneovim-f66ffc64f611cae52df50df0e495b6ef08594e50.tar.bz2
rneovim-f66ffc64f611cae52df50df0e495b6ef08594e50.zip
Remove USE_MCH_ERRMSG
USE_MCH_ERRMSG has never been defined, so the dead code has been removed.
-rw-r--r--src/nvim/globals.h5
-rw-r--r--src/nvim/message.c76
2 files changed, 2 insertions, 79 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 40184a4bb9..6d602d2712 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -904,11 +904,6 @@ EXTERN disptick_T display_tick INIT(= 0);
* cursor position in Insert mode. */
EXTERN linenr_T spell_redraw_lnum INIT(= 0);
-#ifdef USE_MCH_ERRMSG
-// Grow array to collect error messages in until they can be displayed.
-EXTERN garray_T error_ga INIT(= GA_EMPTY_INIT_VALUE);
-#endif
-
/*
* The error messages that can be shared are included here.
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 6f90cde505..e1164ad326 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -2554,78 +2554,7 @@ static int do_more_prompt(int typed_char)
return retval;
}
-#if defined(USE_MCH_ERRMSG) || defined(WIN32)
-
-# ifdef mch_errmsg
-# undef mch_errmsg
-# endif
-# ifdef mch_msg
-# undef mch_msg
-# endif
-
-# if defined(USE_MCH_ERRMSG)
-// Give an error message. To be used when the screen hasn't been initialized
-// yet. When stderr can't be used, collect error messages until the GUI has
-// started and they can be displayed in a message box.
-void mch_errmsg(const char *const str)
- FUNC_ATTR_NONNULL_ALL
-{
-# ifdef UNIX
- // On Unix use stderr if it's a tty.
- // When not going to start the GUI also use stderr.
- // On Mac, when started from Finder, stderr is the console.
- if (os_isatty(2)) {
- fprintf(stderr, "%s", str);
- return;
- }
-# endif
-
- /* avoid a delay for a message that isn't there */
- emsg_on_display = FALSE;
-
- const size_t len = strlen(str) + 1;
- if (error_ga.ga_data == NULL) {
- ga_set_growsize(&error_ga, 80);
- error_ga.ga_itemsize = 1;
- }
- ga_grow(&error_ga, len);
- memmove(error_ga.ga_data + error_ga.ga_len, str, len);
-# ifdef UNIX
- // remove CR characters, they are displayed/
- {
- char_u *p;
-
- p = (char_u *)error_ga.ga_data + error_ga.ga_len;
- for (;; ) {
- p = vim_strchr(p, '\r');
- if (p == NULL)
- break;
- *p = ' ';
- }
- }
-# endif
- len--; // don't count the NUL at the end
- error_ga.ga_len += len;
-}
-
-// Give a message. To be used when the screen hasn't been initialized yet.
-// When there is no tty, collect messages until the GUI has started and they
-// can be displayed in a message box.
-void mch_msg(char *str)
-{
-# ifdef UNIX
- // On Unix use stdout if we have a tty. This allows "vim -h | more" and
- // uses mch_errmsg() when started from the desktop.
- // When not going to start the GUI also use stdout.
- // On Mac, when started from Finder, stderr is the console.
- if (os_isatty(2)) {
- printf("%s", str);
- return;
- }
-# endif
- mch_errmsg(str);
-}
-# else
+#if defined(WIN32)
void mch_errmsg(char *str)
{
wchar_t *utf16str;
@@ -2649,8 +2578,7 @@ void mch_msg(char *str)
xfree(utf16str);
}
}
-# endif // USE_MCH_ERRMSG
-#endif // USE_MCH_ERRMSG && WIN32
+#endif // WIN32
/*
* Put a character on the screen at the current message position and advance