aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-02-07 05:49:52 -0800
committerGitHub <noreply@github.com>2025-02-07 05:49:52 -0800
commitad853d1df093f30d0ca083a0c3a2935496533e8e (patch)
tree76fb37da977e88a24e67c5ccf7b18aaa29f6c55e /src/nvim/main.c
parent52ff5e3032eb5e39b49ce6f4e9a93cffdd39b830 (diff)
downloadrneovim-ad853d1df093f30d0ca083a0c3a2935496533e8e.tar.gz
rneovim-ad853d1df093f30d0ca083a0c3a2935496533e8e.tar.bz2
rneovim-ad853d1df093f30d0ca083a0c3a2935496533e8e.zip
fix(messages): improve deadly signal messages #32364
Problem: Deadly signal messages mention "Vim", and add redundant newlines. Solution: - Update the messages. - Don't add an extra newline.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 0bd4277d19..926ad8ca31 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -845,8 +845,9 @@ void preserve_exit(const char *errmsg)
// For TUI: exit alternate screen so that the error messages can be seen.
ui_client_stop();
}
- if (errmsg != NULL) {
- fprintf(stderr, "%s\n", errmsg);
+ if (errmsg != NULL && errmsg[0] != NUL) {
+ size_t has_eol = '\n' == errmsg[strlen(errmsg) - 1];
+ fprintf(stderr, has_eol ? "%s" : "%s\n", errmsg);
}
if (ui_client_channel_id) {
os_exit(1);
@@ -857,7 +858,7 @@ void preserve_exit(const char *errmsg)
FOR_ALL_BUFFERS(buf) {
if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) {
if (errmsg != NULL) {
- fprintf(stderr, "Vim: preserving files...\r\n");
+ fprintf(stderr, "Nvim: preserving files...\n");
}
ml_sync_all(false, false, true); // preserve all swap files
break;
@@ -867,7 +868,7 @@ void preserve_exit(const char *errmsg)
ml_close_all(false); // close all memfiles, without deleting
if (errmsg != NULL) {
- fprintf(stderr, "Vim: Finished.\r\n");
+ fprintf(stderr, "Nvim: Finished.\n");
}
getout(1);