aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-04-24 12:33:45 -0700
committerMichael Ennen <mike.ennen@gmail.com>2016-04-24 12:52:29 -0700
commit9cf91a8691871c34078a387c09452812e6b2098f (patch)
tree2897716fa9c65ef90a0e80cb6a5c92851929da34 /src/nvim/message.c
parentab63f5d93436094393b0d42d36b69b28e87252f6 (diff)
downloadrneovim-9cf91a8691871c34078a387c09452812e6b2098f.tar.gz
rneovim-9cf91a8691871c34078a387c09452812e6b2098f.tar.bz2
rneovim-9cf91a8691871c34078a387c09452812e6b2098f.zip
vim-patch: 7.4.1347
Problem: When there is any error Vim will use a non-zero exit code. Solution: When using ":silent!" do not set the exit code. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/8b778d55993d951a65f8a59843cecd177c707676
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 97b098c6d2..6086d7cda0 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -467,22 +467,23 @@ int emsg(char_u *s)
{
int attr;
char_u *p;
- int ignore = FALSE;
+ int ignore = false;
int severe;
- /* Skip this if not giving error messages at the moment. */
- if (emsg_not_now())
- return TRUE;
+ // Skip this if not giving error messages at the moment.
+ if (emsg_not_now()) {
+ return true;
+ }
- called_emsg = TRUE;
- ex_exitval = 1;
+ called_emsg = true;
+ if (emsg_silent == 0) {
+ ex_exitval = 1;
+ }
- /*
- * If "emsg_severe" is TRUE: When an error exception is to be thrown,
- * prefer this message over previous messages for the same command.
- */
+ // If "emsg_severe" is TRUE: When an error exception is to be thrown,
+ // prefer this message over previous messages for the same command.
severe = emsg_severe;
- emsg_severe = FALSE;
+ emsg_severe = false;
if (!emsg_off || vim_strchr(p_debug, 't') != NULL) {
/*