aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorMichael Schupikov <michael@schupikov.de>2017-09-23 09:56:44 +0200
committerJames McCoy <jamessan@jamessan.com>2017-12-15 15:50:58 -0500
commitd5bce42b524708a54243658e87b1e3bd9c7acdf3 (patch)
tree2707be6b36b8b5a920bfd73f1b60da011b7e1ced /src/nvim/getchar.c
parent6ff13d78b7eb0a1fae2e2e8cdd054072e1467158 (diff)
downloadrneovim-d5bce42b524708a54243658e87b1e3bd9c7acdf3.tar.gz
rneovim-d5bce42b524708a54243658e87b1e3bd9c7acdf3.tar.bz2
rneovim-d5bce42b524708a54243658e87b1e3bd9c7acdf3.zip
vim-patch:8.0.0074
Problem: Cannot make Vim fail on an internal error. Solution: Add IEMSG() and IEMSG2(). (Domenique Pelle) Avoid reporting an internal error without mentioning where. https://github.com/vim/vim/commit/95f096030ed1a8afea028f2ea295d6f6a70f466f Signed-off-by: Michael Schupikov <michael@schupikov.de>
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 4f8a8528a0..1b5d3472ab 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -254,16 +254,17 @@ static void add_buff(buffheader_T *const buf, const char *const s,
return;
}
- if (buf->bh_first.b_next == NULL) { /* first add to list */
+ if (buf->bh_first.b_next == NULL) { // first add to list
buf->bh_space = 0;
buf->bh_curr = &(buf->bh_first);
- } else if (buf->bh_curr == NULL) { /* buffer has already been read */
- EMSG(_("E222: Add to read buffer"));
+ } else if (buf->bh_curr == NULL) { // buffer has already been read
+ IEMSG(_("E222: Add to read buffer"));
return;
- } else if (buf->bh_index != 0)
+ } else if (buf->bh_index != 0) {
memmove(buf->bh_first.b_next->b_str,
- buf->bh_first.b_next->b_str + buf->bh_index,
- STRLEN(buf->bh_first.b_next->b_str + buf->bh_index) + 1);
+ buf->bh_first.b_next->b_str + buf->bh_index,
+ STRLEN(buf->bh_first.b_next->b_str + buf->bh_index) + 1);
+ }
buf->bh_index = 0;
size_t len;
@@ -1152,14 +1153,16 @@ void alloc_typebuf(void)
*/
void free_typebuf(void)
{
- if (typebuf.tb_buf == typebuf_init)
- EMSG2(_(e_intern2), "Free typebuf 1");
- else
+ if (typebuf.tb_buf == typebuf_init) {
+ internal_error("Free typebuf 1");
+ } else {
xfree(typebuf.tb_buf);
- if (typebuf.tb_noremap == noremapbuf_init)
- EMSG2(_(e_intern2), "Free typebuf 2");
- else
+ }
+ if (typebuf.tb_noremap == noremapbuf_init) {
+ internal_error("Free typebuf 2");
+ } else {
xfree(typebuf.tb_noremap);
+ }
}
/*
@@ -3905,7 +3908,7 @@ makemap (
c1 = 't';
break;
default:
- EMSG(_("E228: makemap: Illegal mode"));
+ IEMSG(_("E228: makemap: Illegal mode"));
return FAIL;
}
do { /* do this twice if c2 is set, 3 times with c3 */