Skip to content

Commit 87243e3

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents fde8fd5 + 8a5883b commit 87243e3

36 files changed

Lines changed: 195 additions & 120 deletions

src/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,10 @@ SANITIZER_LIBS = $(SANITIZER_CFLAGS)
681681
#LEAK_CFLAGS = -DEXITFREE
682682
#LEAK_LIBS = -lccmalloc
683683

684+
# Uncomment this line to have Vim call abort() when an internal error is
685+
# detected. Useful when using a tool to find errors.
686+
#ABORT_CLFAGS = -DABORT_ON_INTERNAL_ERROR
687+
684688
#####################################################
685689
### Specific systems, check if yours is listed! ### {{{
686690
#####################################################
@@ -1426,7 +1430,7 @@ SHELL = /bin/sh
14261430
PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
14271431
POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(EXTRA_DEFS)
14281432

1429-
ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS)
1433+
ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(ABORT_CLFAGS) $(POST_DEFS)
14301434

14311435
# Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
14321436
# with "-E".

src/blowfish.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ bf_key_init(
426426
keylen = (int)STRLEN(key) / 2;
427427
if (keylen == 0)
428428
{
429-
EMSG(_("E831: bf_key_init() called with empty password"));
429+
IEMSG(_("E831: bf_key_init() called with empty password"));
430430
return;
431431
}
432432
for (i = 0; i < keylen; i++)

src/buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ do_buffer(
14161416
# ifdef FEAT_AUTOCMD
14171417
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
14181418
# endif
1419-
&& (firstwin != lastwin || first_tabpage->tp_next != NULL))
1419+
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL))
14201420
{
14211421
if (win_close(curwin, FALSE) == FAIL)
14221422
break;
@@ -5150,7 +5150,7 @@ ex_buffer_all(exarg_T *eap)
51505150
: wp->w_width != Columns)
51515151
|| (had_tab > 0 && wp != firstwin)
51525152
#endif
5153-
) && firstwin != lastwin
5153+
) && !ONE_WINDOW
51545154
#ifdef FEAT_AUTOCMD
51555155
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
51565156
#endif

src/dict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ dictitem_remove(dict_T *dict, dictitem_T *item)
214214

215215
hi = hash_find(&dict->dv_hashtab, item->di_key);
216216
if (HASHITEM_EMPTY(hi))
217-
EMSG2(_(e_intern2), "dictitem_remove()");
217+
internal_error("dictitem_remove()");
218218
else
219219
hash_remove(&dict->dv_hashtab, hi);
220220
dictitem_free(item);

src/edit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,7 @@ vim_is_ctrl_x_key(int c)
23082308
case CTRL_X_EVAL:
23092309
return (c == Ctrl_P || c == Ctrl_N);
23102310
}
2311-
EMSG(_(e_internal));
2311+
internal_error("vim_is_ctrl_x_key()");
23122312
return FALSE;
23132313
}
23142314

@@ -5445,7 +5445,7 @@ ins_complete(int c, int enable_pum)
54455445
}
54465446
else
54475447
{
5448-
EMSG2(_(e_intern2), "ins_complete()");
5448+
internal_error("ins_complete()");
54495449
return FAIL;
54505450
}
54515451

src/eval.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ restore_vimvar(int idx, typval_T *save_tv)
839839
{
840840
hi = hash_find(&vimvarht, vimvars[idx].vv_di.di_key);
841841
if (HASHITEM_EMPTY(hi))
842-
EMSG2(_(e_intern2), "restore_vimvar()");
842+
internal_error("restore_vimvar()");
843843
else
844844
hash_remove(&vimvarht, hi);
845845
}
@@ -1308,7 +1308,7 @@ ex_let_vars(
13081308
}
13091309
else if (*arg != ',' && *arg != ']')
13101310
{
1311-
EMSG2(_(e_intern2), "ex_let_vars()");
1311+
internal_error("ex_let_vars()");
13121312
return FAIL;
13131313
}
13141314
}
@@ -2830,7 +2830,7 @@ do_unlet(char_u *name, int forceit)
28302830
}
28312831
if (d == NULL)
28322832
{
2833-
EMSG2(_(e_intern2), "do_unlet()");
2833+
internal_error("do_unlet()");
28342834
return FAIL;
28352835
}
28362836
}
@@ -5678,7 +5678,7 @@ get_var_special_name(int nr)
56785678
case VVAL_NONE: return "v:none";
56795679
case VVAL_NULL: return "v:null";
56805680
}
5681-
EMSG2(_(e_intern2), "get_var_special_name()");
5681+
internal_error("get_var_special_name()");
56825682
return "42";
56835683
}
56845684

@@ -7152,7 +7152,7 @@ get_tv_number_chk(typval_T *varp, int *denote)
71527152
break;
71537153
#endif
71547154
case VAR_UNKNOWN:
7155-
EMSG2(_(e_intern2), "get_tv_number(UNKNOWN)");
7155+
internal_error("get_tv_number(UNKNOWN)");
71567156
break;
71577157
}
71587158
if (denote == NULL) /* useful for values that must be unsigned */
@@ -7199,7 +7199,7 @@ get_tv_float(typval_T *varp)
71997199
break;
72007200
# endif
72017201
case VAR_UNKNOWN:
7202-
EMSG2(_(e_intern2), "get_tv_float(UNKNOWN)");
7202+
internal_error("get_tv_float(UNKNOWN)");
72037203
break;
72047204
}
72057205
return 0;
@@ -7733,7 +7733,7 @@ set_var(
77337733
return;
77347734
}
77357735
else if (v->di_tv.v_type != tv->v_type)
7736-
EMSG2(_(e_intern2), "set_var()");
7736+
internal_error("set_var()");
77377737
}
77387738

77397739
clear_tv(&v->di_tv);
@@ -7962,7 +7962,7 @@ copy_tv(typval_T *from, typval_T *to)
79627962
}
79637963
break;
79647964
case VAR_UNKNOWN:
7965-
EMSG2(_(e_intern2), "copy_tv(UNKNOWN)");
7965+
internal_error("copy_tv(UNKNOWN)");
79667966
break;
79677967
}
79687968
}
@@ -8036,7 +8036,7 @@ item_copy(
80368036
ret = FAIL;
80378037
break;
80388038
case VAR_UNKNOWN:
8039-
EMSG2(_(e_intern2), "item_copy(UNKNOWN)");
8039+
internal_error("item_copy(UNKNOWN)");
80408040
ret = FAIL;
80418041
}
80428042
--recurse;

src/evalfunc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,7 +2644,7 @@ f_empty(typval_T *argvars, typval_T *rettv)
26442644
break;
26452645
#endif
26462646
case VAR_UNKNOWN:
2647-
EMSG2(_(e_intern2), "f_empty(UNKNOWN)");
2647+
internal_error("f_empty(UNKNOWN)");
26482648
n = TRUE;
26492649
break;
26502650
}
@@ -12722,7 +12722,7 @@ f_type(typval_T *argvars, typval_T *rettv)
1272212722
case VAR_JOB: n = VAR_TYPE_JOB; break;
1272312723
case VAR_CHANNEL: n = VAR_TYPE_CHANNEL; break;
1272412724
case VAR_UNKNOWN:
12725-
EMSG2(_(e_intern2), "f_type(UNKNOWN)");
12725+
internal_error("f_type(UNKNOWN)");
1272612726
n = -1;
1272712727
break;
1272812728
}

src/ex_cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4577,7 +4577,7 @@ ex_z(exarg_T *eap)
45774577
if (eap->forceit)
45784578
bigness = curwin->w_height;
45794579
#ifdef FEAT_WINDOWS
4580-
else if (firstwin != lastwin)
4580+
else if (!ONE_WINDOW)
45814581
bigness = curwin->w_height - 3;
45824582
#endif
45834583
else

src/ex_docmd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,8 +1395,6 @@ do_cmdline(
13951395
break;
13961396
case ET_INTERRUPT:
13971397
break;
1398-
default:
1399-
p = vim_strsave((char_u *)_(e_internal));
14001398
}
14011399

14021400
saved_sourcing_name = sourcing_name;
@@ -7505,9 +7503,9 @@ tabpage_close(int forceit)
75057503
{
75067504
/* First close all the windows but the current one. If that worked then
75077505
* close the last window in this tab, that will close it. */
7508-
if (lastwin != firstwin)
7506+
if (!ONE_WINDOW)
75097507
close_others(TRUE, forceit);
7510-
if (lastwin == firstwin)
7508+
if (ONE_WINDOW)
75117509
ex_win_close(forceit, curwin, NULL);
75127510
# ifdef FEAT_GUI
75137511
need_mouse_correct = TRUE;

src/ex_eval.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#if defined(FEAT_EVAL) || defined(PROTO)
1717

1818
static void free_msglist(struct msglist *l);
19-
static int throw_exception(void *, int, char_u *);
19+
static int throw_exception(void *, except_type_T, char_u *);
2020
static char_u *get_end_emsg(struct condstack *cstack);
2121

2222
/*
@@ -422,7 +422,7 @@ do_intthrow(struct condstack *cstack)
422422
char_u *
423423
get_exception_string(
424424
void *value,
425-
int type,
425+
except_type_T type,
426426
char_u *cmdname,
427427
int *should_free)
428428
{
@@ -503,7 +503,7 @@ get_exception_string(
503503
* error exception.
504504
*/
505505
static int
506-
throw_exception(void *value, int type, char_u *cmdname)
506+
throw_exception(void *value, except_type_T type, char_u *cmdname)
507507
{
508508
except_T *excp;
509509
int should_free;
@@ -595,7 +595,7 @@ discard_exception(except_T *excp, int was_finished)
595595

596596
if (excp == NULL)
597597
{
598-
EMSG(_(e_internal));
598+
internal_error("discard_exception()");
599599
return;
600600
}
601601

@@ -700,7 +700,7 @@ catch_exception(except_T *excp)
700700
finish_exception(except_T *excp)
701701
{
702702
if (excp != caught_stack)
703-
EMSG(_(e_internal));
703+
internal_error("finish_exception()");
704704
caught_stack = caught_stack->caught;
705705
if (caught_stack != NULL)
706706
{
@@ -1603,7 +1603,7 @@ ex_catch(exarg_T *eap)
16031603
* ":break", ":return", ":finish", error, interrupt, or another
16041604
* exception. */
16051605
if (cstack->cs_exception[cstack->cs_idx] != current_exception)
1606-
EMSG(_(e_internal));
1606+
internal_error("ex_catch()");
16071607
}
16081608
else
16091609
{
@@ -1737,7 +1737,7 @@ ex_finally(exarg_T *eap)
17371737
* exception will be discarded. */
17381738
if (did_throw && cstack->cs_exception[cstack->cs_idx]
17391739
!= current_exception)
1740-
EMSG(_(e_internal));
1740+
internal_error("ex_finally()");
17411741
}
17421742

17431743
/*

0 commit comments

Comments
 (0)