Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2016-11-10 19:29:48 -08:00
36 changed files with 195 additions and 120 deletions
+5 -1
View File
@@ -681,6 +681,10 @@ SANITIZER_LIBS = $(SANITIZER_CFLAGS)
#LEAK_CFLAGS = -DEXITFREE
#LEAK_LIBS = -lccmalloc
# Uncomment this line to have Vim call abort() when an internal error is
# detected. Useful when using a tool to find errors.
#ABORT_CLFAGS = -DABORT_ON_INTERNAL_ERROR
#####################################################
### Specific systems, check if yours is listed! ### {{{
#####################################################
@@ -1426,7 +1430,7 @@ SHELL = /bin/sh
PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(EXTRA_DEFS)
ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS)
ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(ABORT_CLFAGS) $(POST_DEFS)
# Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
# with "-E".
+1 -1
View File
@@ -426,7 +426,7 @@ bf_key_init(
keylen = (int)STRLEN(key) / 2;
if (keylen == 0)
{
EMSG(_("E831: bf_key_init() called with empty password"));
IEMSG(_("E831: bf_key_init() called with empty password"));
return;
}
for (i = 0; i < keylen; i++)
+2 -2
View File
@@ -1416,7 +1416,7 @@ do_buffer(
# ifdef FEAT_AUTOCMD
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
# endif
&& (firstwin != lastwin || first_tabpage->tp_next != NULL))
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL))
{
if (win_close(curwin, FALSE) == FAIL)
break;
@@ -5150,7 +5150,7 @@ ex_buffer_all(exarg_T *eap)
: wp->w_width != Columns)
|| (had_tab > 0 && wp != firstwin)
#endif
) && firstwin != lastwin
) && !ONE_WINDOW
#ifdef FEAT_AUTOCMD
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
#endif
+1 -1
View File
@@ -214,7 +214,7 @@ dictitem_remove(dict_T *dict, dictitem_T *item)
hi = hash_find(&dict->dv_hashtab, item->di_key);
if (HASHITEM_EMPTY(hi))
EMSG2(_(e_intern2), "dictitem_remove()");
internal_error("dictitem_remove()");
else
hash_remove(&dict->dv_hashtab, hi);
dictitem_free(item);
+2 -2
View File
@@ -2308,7 +2308,7 @@ vim_is_ctrl_x_key(int c)
case CTRL_X_EVAL:
return (c == Ctrl_P || c == Ctrl_N);
}
EMSG(_(e_internal));
internal_error("vim_is_ctrl_x_key()");
return FALSE;
}
@@ -5445,7 +5445,7 @@ ins_complete(int c, int enable_pum)
}
else
{
EMSG2(_(e_intern2), "ins_complete()");
internal_error("ins_complete()");
return FAIL;
}
+9 -9
View File
@@ -839,7 +839,7 @@ restore_vimvar(int idx, typval_T *save_tv)
{
hi = hash_find(&vimvarht, vimvars[idx].vv_di.di_key);
if (HASHITEM_EMPTY(hi))
EMSG2(_(e_intern2), "restore_vimvar()");
internal_error("restore_vimvar()");
else
hash_remove(&vimvarht, hi);
}
@@ -1308,7 +1308,7 @@ ex_let_vars(
}
else if (*arg != ',' && *arg != ']')
{
EMSG2(_(e_intern2), "ex_let_vars()");
internal_error("ex_let_vars()");
return FAIL;
}
}
@@ -2830,7 +2830,7 @@ do_unlet(char_u *name, int forceit)
}
if (d == NULL)
{
EMSG2(_(e_intern2), "do_unlet()");
internal_error("do_unlet()");
return FAIL;
}
}
@@ -5678,7 +5678,7 @@ get_var_special_name(int nr)
case VVAL_NONE: return "v:none";
case VVAL_NULL: return "v:null";
}
EMSG2(_(e_intern2), "get_var_special_name()");
internal_error("get_var_special_name()");
return "42";
}
@@ -7152,7 +7152,7 @@ get_tv_number_chk(typval_T *varp, int *denote)
break;
#endif
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "get_tv_number(UNKNOWN)");
internal_error("get_tv_number(UNKNOWN)");
break;
}
if (denote == NULL) /* useful for values that must be unsigned */
@@ -7199,7 +7199,7 @@ get_tv_float(typval_T *varp)
break;
# endif
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "get_tv_float(UNKNOWN)");
internal_error("get_tv_float(UNKNOWN)");
break;
}
return 0;
@@ -7733,7 +7733,7 @@ set_var(
return;
}
else if (v->di_tv.v_type != tv->v_type)
EMSG2(_(e_intern2), "set_var()");
internal_error("set_var()");
}
clear_tv(&v->di_tv);
@@ -7962,7 +7962,7 @@ copy_tv(typval_T *from, typval_T *to)
}
break;
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "copy_tv(UNKNOWN)");
internal_error("copy_tv(UNKNOWN)");
break;
}
}
@@ -8036,7 +8036,7 @@ item_copy(
ret = FAIL;
break;
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "item_copy(UNKNOWN)");
internal_error("item_copy(UNKNOWN)");
ret = FAIL;
}
--recurse;
+2 -2
View File
@@ -2644,7 +2644,7 @@ f_empty(typval_T *argvars, typval_T *rettv)
break;
#endif
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "f_empty(UNKNOWN)");
internal_error("f_empty(UNKNOWN)");
n = TRUE;
break;
}
@@ -12722,7 +12722,7 @@ f_type(typval_T *argvars, typval_T *rettv)
case VAR_JOB: n = VAR_TYPE_JOB; break;
case VAR_CHANNEL: n = VAR_TYPE_CHANNEL; break;
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "f_type(UNKNOWN)");
internal_error("f_type(UNKNOWN)");
n = -1;
break;
}
+1 -1
View File
@@ -4577,7 +4577,7 @@ ex_z(exarg_T *eap)
if (eap->forceit)
bigness = curwin->w_height;
#ifdef FEAT_WINDOWS
else if (firstwin != lastwin)
else if (!ONE_WINDOW)
bigness = curwin->w_height - 3;
#endif
else
+2 -4
View File
@@ -1395,8 +1395,6 @@ do_cmdline(
break;
case ET_INTERRUPT:
break;
default:
p = vim_strsave((char_u *)_(e_internal));
}
saved_sourcing_name = sourcing_name;
@@ -7505,9 +7503,9 @@ tabpage_close(int forceit)
{
/* First close all the windows but the current one. If that worked then
* close the last window in this tab, that will close it. */
if (lastwin != firstwin)
if (!ONE_WINDOW)
close_others(TRUE, forceit);
if (lastwin == firstwin)
if (ONE_WINDOW)
ex_win_close(forceit, curwin, NULL);
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
+7 -7
View File
@@ -16,7 +16,7 @@
#if defined(FEAT_EVAL) || defined(PROTO)
static void free_msglist(struct msglist *l);
static int throw_exception(void *, int, char_u *);
static int throw_exception(void *, except_type_T, char_u *);
static char_u *get_end_emsg(struct condstack *cstack);
/*
@@ -422,7 +422,7 @@ do_intthrow(struct condstack *cstack)
char_u *
get_exception_string(
void *value,
int type,
except_type_T type,
char_u *cmdname,
int *should_free)
{
@@ -503,7 +503,7 @@ get_exception_string(
* error exception.
*/
static int
throw_exception(void *value, int type, char_u *cmdname)
throw_exception(void *value, except_type_T type, char_u *cmdname)
{
except_T *excp;
int should_free;
@@ -595,7 +595,7 @@ discard_exception(except_T *excp, int was_finished)
if (excp == NULL)
{
EMSG(_(e_internal));
internal_error("discard_exception()");
return;
}
@@ -700,7 +700,7 @@ catch_exception(except_T *excp)
finish_exception(except_T *excp)
{
if (excp != caught_stack)
EMSG(_(e_internal));
internal_error("finish_exception()");
caught_stack = caught_stack->caught;
if (caught_stack != NULL)
{
@@ -1603,7 +1603,7 @@ ex_catch(exarg_T *eap)
* ":break", ":return", ":finish", error, interrupt, or another
* exception. */
if (cstack->cs_exception[cstack->cs_idx] != current_exception)
EMSG(_(e_internal));
internal_error("ex_catch()");
}
else
{
@@ -1737,7 +1737,7 @@ ex_finally(exarg_T *eap)
* exception will be discarded. */
if (did_throw && cstack->cs_exception[cstack->cs_idx]
!= current_exception)
EMSG(_(e_internal));
internal_error("ex_finally()");
}
/*
+4 -4
View File
@@ -250,7 +250,7 @@ add_buff(
}
else if (buf->bh_curr == NULL) /* buffer has already been read */
{
EMSG(_("E222: Add to read buffer"));
IEMSG(_("E222: Add to read buffer"));
return;
}
else if (buf->bh_index != 0)
@@ -1321,11 +1321,11 @@ alloc_typebuf(void)
free_typebuf(void)
{
if (typebuf.tb_buf == typebuf_init)
EMSG2(_(e_intern2), "Free typebuf 1");
internal_error("Free typebuf 1");
else
vim_free(typebuf.tb_buf);
if (typebuf.tb_noremap == noremapbuf_init)
EMSG2(_(e_intern2), "Free typebuf 2");
internal_error("Free typebuf 2");
else
vim_free(typebuf.tb_noremap);
}
@@ -4868,7 +4868,7 @@ makemap(
c1 = 'l';
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 */
+1 -1
View File
@@ -1444,6 +1444,7 @@ EXTERN char_u e_font[] INIT(= N_("E235: Unknown font: %s"));
EXTERN char_u e_fontwidth[] INIT(= N_("E236: Font \"%s\" is not fixed-width"));
#endif
EXTERN char_u e_internal[] INIT(= N_("E473: Internal error"));
EXTERN char_u e_intern2[] INIT(= N_("E685: Internal error: %s"));
EXTERN char_u e_interr[] INIT(= N_("Interrupted"));
EXTERN char_u e_invaddr[] INIT(= N_("E14: Invalid address"));
EXTERN char_u e_invarg[] INIT(= N_("E474: Invalid argument"));
@@ -1593,7 +1594,6 @@ EXTERN char_u e_invexprmsg[] INIT(= N_("E449: Invalid expression received"));
EXTERN char_u e_guarded[] INIT(= N_("E463: Region is guarded, cannot modify"));
EXTERN char_u e_nbreadonly[] INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
#endif
EXTERN char_u e_intern2[] INIT(= N_("E685: Internal error: %s"));
EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
EXTERN char_u e_nobufnr[] INIT(= N_("E86: Buffer %ld does not exist"));
+1 -1
View File
@@ -218,7 +218,7 @@ gui_mch_create_beval_area(
if (mesg != NULL && mesgCB != NULL)
{
EMSG(_("E232: Cannot create BalloonEval with both message and callback"));
IEMSG(_("E232: Cannot create BalloonEval with both message and callback"));
return NULL;
}
+1 -1
View File
@@ -8620,7 +8620,7 @@ gui_mch_create_beval_area(
if (mesg != NULL && mesgCB != NULL)
{
EMSG(_("E232: Cannot create BalloonEval with both message and callback"));
IEMSG(_("E232: Cannot create BalloonEval with both message and callback"));
return NULL;
}
+1 -1
View File
@@ -590,7 +590,7 @@ hangul_automata2(char_u *buf, int_u *c)
return AUTOMATA_CORRECT_NEW;
default:
EMSG(_("E256: Hangul automata ERROR"));
IEMSG(_("E256: Hangul automata ERROR"));
break;
}
return AUTOMATA_ERROR; /* RrEeAaLlLlYy EeRrRrOoRr */
+1 -1
View File
@@ -210,7 +210,7 @@ hash_add(hashtab_T *ht, char_u *key)
hi = hash_lookup(ht, key, hash);
if (!HASHITEM_EMPTY(hi))
{
EMSG2(_(e_intern2), "hash_add()");
internal_error("hash_add()");
return FAIL;
}
return hash_add_item(ht, hi, key, hash);
+1 -1
View File
@@ -1792,7 +1792,7 @@ cs_manage_matches(
cs_print_tags_priv(mp, cp, cnt);
break;
default: /* should not reach here */
(void)EMSG(_("E570: fatal error in cs_manage_matches"));
IEMSG(_("E570: fatal error in cs_manage_matches"));
return NULL;
}
+1 -1
View File
@@ -328,7 +328,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
break;
#endif
case VAR_UNKNOWN:
EMSG2(_(e_intern2), "json_encode_item()");
internal_error("json_encode_item()");
return FAIL;
}
return OK;
+1 -1
View File
@@ -482,7 +482,7 @@ mf_put(
flags = hp->bh_flags;
if ((flags & BH_LOCKED) == 0)
EMSG(_("E293: block was not locked"));
IEMSG(_("E293: block was not locked"));
flags &= ~BH_LOCKED;
if (dirty)
{
+14 -14
View File
@@ -333,7 +333,7 @@ ml_open(buf_T *buf)
goto error;
if (hp->bh_bnum != 0)
{
EMSG(_("E298: Didn't get block nr 0?"));
IEMSG(_("E298: Didn't get block nr 0?"));
goto error;
}
b0p = (ZERO_BL *)(hp->bh_data);
@@ -383,7 +383,7 @@ ml_open(buf_T *buf)
goto error;
if (hp->bh_bnum != 1)
{
EMSG(_("E298: Didn't get block nr 1?"));
IEMSG(_("E298: Didn't get block nr 1?"));
goto error;
}
pp = (PTR_BL *)(hp->bh_data);
@@ -401,7 +401,7 @@ ml_open(buf_T *buf)
goto error;
if (hp->bh_bnum != 2)
{
EMSG(_("E298: Didn't get block nr 2?"));
IEMSG(_("E298: Didn't get block nr 2?"));
goto error;
}
@@ -950,7 +950,7 @@ ml_upd_block0(buf_T *buf, upd_block0_T what)
b0p = (ZERO_BL *)(hp->bh_data);
if (ml_check_b0_id(b0p) == FAIL)
EMSG(_("E304: ml_upd_block0(): Didn't get block 0??"));
IEMSG(_("E304: ml_upd_block0(): Didn't get block 0??"));
else
{
if (what == UB_FNAME)
@@ -2450,7 +2450,7 @@ ml_get_buf(
/* Avoid giving this message for a recursive call, may happen when
* the GUI redraws part of the text. */
++recursive;
EMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum);
IEMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum);
--recursive;
}
errorret:
@@ -2485,7 +2485,7 @@ errorret:
/* Avoid giving this message for a recursive call, may happen
* when the GUI redraws part of the text. */
++recursive;
EMSGN(_("E316: ml_get: cannot find line %ld"), lnum);
IEMSGN(_("E316: ml_get: cannot find line %ld"), lnum);
--recursive;
}
goto errorret;
@@ -2900,7 +2900,7 @@ ml_append_int(
pp = (PTR_BL *)(hp->bh_data); /* must be pointer block */
if (pp->pb_id != PTR_ID)
{
EMSG(_("E317: pointer block id wrong 3"));
IEMSG(_("E317: pointer block id wrong 3"));
mf_put(mfp, hp, FALSE, FALSE);
return FAIL;
}
@@ -3042,7 +3042,7 @@ ml_append_int(
*/
if (stack_idx < 0)
{
EMSG(_("E318: Updated too many blocks?"));
IEMSG(_("E318: Updated too many blocks?"));
buf->b_ml.ml_stack_top = 0; /* invalidate stack */
}
}
@@ -3220,7 +3220,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int message)
pp = (PTR_BL *)(hp->bh_data); /* must be pointer block */
if (pp->pb_id != PTR_ID)
{
EMSG(_("E317: pointer block id wrong 4"));
IEMSG(_("E317: pointer block id wrong 4"));
mf_put(mfp, hp, FALSE, FALSE);
return FAIL;
}
@@ -3432,7 +3432,7 @@ ml_flush_line(buf_T *buf)
hp = ml_find_line(buf, lnum, ML_FIND);
if (hp == NULL)
EMSGN(_("E320: Cannot find line %ld"), lnum);
IEMSGN(_("E320: Cannot find line %ld"), lnum);
else
{
dp = (DATA_BL *)(hp->bh_data);
@@ -3674,7 +3674,7 @@ ml_find_line(buf_T *buf, linenr_T lnum, int action)
pp = (PTR_BL *)(dp); /* must be pointer block */
if (pp->pb_id != PTR_ID)
{
EMSG(_("E317: pointer block id wrong"));
IEMSG(_("E317: pointer block id wrong"));
goto error_block;
}
@@ -3719,11 +3719,11 @@ ml_find_line(buf_T *buf, linenr_T lnum, int action)
if (idx >= (int)pp->pb_count) /* past the end: something wrong! */
{
if (lnum > buf->b_ml.ml_line_count)
EMSGN(_("E322: line number out of range: %ld past the end"),
IEMSGN(_("E322: line number out of range: %ld past the end"),
lnum - buf->b_ml.ml_line_count);
else
EMSGN(_("E323: line count wrong in block %ld"), bnum);
IEMSGN(_("E323: line count wrong in block %ld"), bnum);
goto error_block;
}
if (action == ML_DELETE)
@@ -3817,7 +3817,7 @@ ml_lineadd(buf_T *buf, int count)
if (pp->pb_id != PTR_ID)
{
mf_put(mfp, hp, FALSE, FALSE);
EMSG(_("E317: pointer block id wrong 2"));
IEMSG(_("E317: pointer block id wrong 2"));
break;
}
pp->pb_pointer[ip->ip_index].pe_line_count += count;
+79
View File
@@ -662,6 +662,7 @@ emsg(char_u *s)
return msg_attr(s, attr);
}
/*
* Print an error message with one "%s" and one string argument.
*/
@@ -671,6 +672,84 @@ emsg2(char_u *s, char_u *a1)
return emsg3(s, a1, NULL);
}
/*
* Print an error message with one or two "%s" and one or two string arguments.
* This is not in message.c to avoid a warning for prototypes.
*/
int
emsg3(char_u *s, char_u *a1, char_u *a2)
{
if (emsg_not_now())
return TRUE; /* no error messages at the moment */
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, a1, a2);
return emsg(IObuff);
}
/*
* Print an error message with one "%ld" and one long int argument.
* This is not in message.c to avoid a warning for prototypes.
*/
int
emsgn(char_u *s, long n)
{
if (emsg_not_now())
return TRUE; /* no error messages at the moment */
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n);
return emsg(IObuff);
}
/*
* Same as emsg(...), but abort on error when ABORT_ON_INTERNAL_ERROR is
* defined. It is used for internal errors only, so that they can be
* detected when fuzzing vim.
*/
void
iemsg(char_u *s)
{
msg(s);
#ifdef ABORT_ON_INTERNAL_ERROR
abort();
#endif
}
/*
* Same as emsg2(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
* defined. It is used for internal errors only, so that they can be
* detected when fuzzing vim.
*/
void
iemsg2(char_u *s, char_u *a1)
{
emsg2(s, a1);
#ifdef ABORT_ON_INTERNAL_ERROR
abort();
#endif
}
/*
* Same as emsgn(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
* defined. It is used for internal errors only, so that they can be
* detected when fuzzing vim.
*/
void
iemsgn(char_u *s, long n)
{
emsgn(s, n);
#ifdef ABORT_ON_INTERNAL_ERROR
abort();
#endif
}
/*
* Give an "Internal error" message.
*/
void
internal_error(char *where)
{
IEMSG2(_(e_intern2), where);
}
/* emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. */
void
+2 -28
View File
@@ -918,7 +918,7 @@ lalloc(long_u size, int message)
{
/* Don't hide this message */
emsg_silent = 0;
EMSGN(_("E341: Internal error: lalloc(%ld, )"), size);
IEMSGN(_("E341: Internal error: lalloc(%ld, )"), size);
return NULL;
}
@@ -1075,7 +1075,7 @@ free_all_mem(void)
p_ea = FALSE;
if (first_tabpage->tp_next != NULL)
do_cmdline_cmd((char_u *)"tabonly!");
if (firstwin != lastwin)
if (!ONE_WINDOW)
do_cmdline_cmd((char_u *)"only!");
# endif
@@ -6046,32 +6046,6 @@ filewritable(char_u *fname)
}
#endif
/*
* Print an error message with one or two "%s" and one or two string arguments.
* This is not in message.c to avoid a warning for prototypes.
*/
int
emsg3(char_u *s, char_u *a1, char_u *a2)
{
if (emsg_not_now())
return TRUE; /* no error messages at the moment */
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, a1, a2);
return emsg(IObuff);
}
/*
* Print an error message with one "%ld" and one long int argument.
* This is not in message.c to avoid a warning for prototypes.
*/
int
emsgn(char_u *s, long n)
{
if (emsg_not_now())
return TRUE; /* no error messages at the moment */
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n);
return emsg(IObuff);
}
#if defined(FEAT_SPELL) || defined(FEAT_PERSISTENT_UNDO) || defined(PROTO)
/*
* Read 2 bytes from "fd" and turn them into an int, MSB first.
+7 -7
View File
@@ -5700,7 +5700,7 @@ was_set_insecurely(char_u *opt, int opt_flags)
flagp = insecure_flag(idx, opt_flags);
return (*flagp & P_INSECURE) != 0;
}
EMSG2(_(e_intern2), "was_set_insecurely()");
internal_error("was_set_insecurely()");
return -1;
}
@@ -5781,7 +5781,7 @@ set_string_option_direct(
if (idx < 0) /* not found (should not happen) */
{
EMSG2(_(e_intern2), "set_string_option_direct()");
EMSG2(_("For option %s"), name);
IEMSG2(_("For option %s"), name);
return;
}
}
@@ -8699,7 +8699,7 @@ set_num_option(
}
/* Change window height NOW */
if (lastwin != firstwin)
if (!ONE_WINDOW)
{
if (pp == &p_wh && curwin->w_height < p_wh)
win_setheight((int)p_wh);
@@ -8739,7 +8739,7 @@ set_num_option(
}
/* Change window width NOW */
if (lastwin != firstwin && curwin->w_width < p_wiw)
if (!ONE_WINDOW && curwin->w_width < p_wiw)
win_setwidth((int)p_wiw);
}
@@ -9550,7 +9550,7 @@ option_iter_next(void **option, int opt_type)
ret = NULL;
break;
default:
EMSG2(_(e_intern2), "option_iter_next()");
internal_error("option_iter_next()");
return NULL;
}
}
@@ -10250,7 +10250,7 @@ istermoption(struct vimoption *p)
comp_col(void)
{
#if defined(FEAT_CMDL_INFO) && defined(FEAT_WINDOWS)
int last_has_status = (p_ls == 2 || (p_ls == 1 && firstwin != lastwin));
int last_has_status = (p_ls == 2 || (p_ls == 1 && !ONE_WINDOW));
sc_col = 0;
ru_col = 0;
@@ -10674,7 +10674,7 @@ get_varp(struct vimoption *p)
#ifdef FEAT_SIGNS
case PV_SCL: return (char_u *)&(curwin->w_p_scl);
#endif
default: EMSG(_("E356: get_varp ERROR"));
default: IEMSG(_("E356: get_varp ERROR"));
}
/* always return a valid pointer to avoid a crash! */
return (char_u *)&(curbuf->b_p_wm);
+1 -1
View File
@@ -2893,7 +2893,7 @@ get_logfont(
*/
for (p = name; *p && *p != ':'; p++)
{
if (p - name + 1 > LF_FACESIZE)
if (p - name + 1 >= LF_FACESIZE)
goto theend; /* Name too long */
lf->lfFaceName[p - name] = *p;
}
+1 -1
View File
@@ -7,7 +7,7 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore);
void free_global_msglist(void);
void do_errthrow(struct condstack *cstack, char_u *cmdname);
int do_intthrow(struct condstack *cstack);
char_u *get_exception_string(void *value, int type, char_u *cmdname, int *should_free);
char_u *get_exception_string(void *value, except_type_T type, char_u *cmdname, int *should_free);
void discard_current_exception(void);
void report_make_pending(int pending, void *value);
void report_resume_pending(int pending, void *value);
+6
View File
@@ -11,6 +11,12 @@ int emsg_not_now(void);
void do_perror(char *msg);
int emsg(char_u *s);
int emsg2(char_u *s, char_u *a1);
int emsg3(char_u *s, char_u *a1, char_u *a2);
int emsgn(char_u *s, long n);
void iemsg(char_u *s);
void iemsg2(char_u *s, char_u *a1);
void iemsgn(char_u *s, long n);
void internal_error(char *where);
void emsg_invreg(int name);
char_u *msg_trunc_attr(char_u *s, int force, int attr);
char_u *msg_may_trunc(int force, char_u *s);
-2
View File
@@ -99,8 +99,6 @@ int get_user_name(char_u *buf, int len);
void sort_strings(char_u **files, int count);
int pathcmp(const char *p, const char *q, int maxlen);
int filewritable(char_u *fname);
int emsg3(char_u *s, char_u *a1, char_u *a2);
int emsgn(char_u *s, long n);
int get2c(FILE *fd);
int get3c(FILE *fd);
int get4c(FILE *fd);
+1 -1
View File
@@ -3231,7 +3231,7 @@ qf_fill_buffer(qf_info_T *qi, buf_T *buf, qfline_T *old_last)
{
if (buf != curbuf)
{
EMSG2(_(e_intern2), "qf_fill_buffer()");
internal_error("qf_fill_buffer()");
return;
}
+4 -2
View File
@@ -335,11 +335,13 @@ toggle_Magic(int x)
/* Used for an error (down from) vim_regcomp(): give the error message, set
* rc_did_emsg and return NULL */
#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, (void *)NULL)
#define IEMSG_RET_NULL(m) return (IEMSG(m), rc_did_emsg = TRUE, (void *)NULL)
#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL)
#define EMSG2_RET_NULL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, (void *)NULL)
#define EMSG2_RET_FAIL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, FAIL)
#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
#define MAX_LIMIT (32767L << 16L)
static int re_multi_type(int);
@@ -2043,7 +2045,7 @@ regatom(int *flagp)
case Magic(')'):
if (one_exactly)
EMSG_ONE_RET_NULL;
EMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
IEMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
/* NOTREACHED */
case Magic('='):
@@ -5070,7 +5072,7 @@ regmatch(
}
else
{
EMSG(_(e_internal)); /* Shouldn't happen */
internal_error("BRACE_LIMITS");
status = RA_FAIL;
}
}
+1 -1
View File
@@ -6428,7 +6428,7 @@ add_sound_suggest(
sfwordnr = soundfold_find(slang, goodword);
if (sfwordnr < 0)
{
EMSG2(_(e_intern2), "add_sound_suggest()");
internal_error("add_sound_suggest()");
return;
}
+11 -8
View File
@@ -814,6 +814,16 @@ struct msglist
struct msglist *next; /* next of several messages in a row */
};
/*
* The exception types.
*/
typedef enum
{
ET_USER, /* exception caused by ":throw" command */
ET_ERROR, /* error exception */
ET_INTERRUPT /* interrupt exception triggered by Ctrl-C */
} except_type_T;
/*
* Structure describing an exception.
* (don't use "struct exception", it's used by the math library).
@@ -821,7 +831,7 @@ struct msglist
typedef struct vim_exception except_T;
struct vim_exception
{
int type; /* exception type */
except_type_T type; /* exception type */
char_u *value; /* exception value */
struct msglist *messages; /* message(s) causing error exception */
char_u *throw_name; /* name of the throw point */
@@ -829,13 +839,6 @@ struct vim_exception
except_T *caught; /* next exception on the caught stack */
};
/*
* The exception types.
*/
#define ET_USER 0 /* exception caused by ":throw" command */
#define ET_ERROR 1 /* error exception */
#define ET_INTERRUPT 2 /* interrupt exception triggered by Ctrl-C */
/*
* Structure to save the error/interrupt/exception state between calls to
* enter_cleanup() and leave_cleanup(). Must be allocated as an automatic
+4 -4
View File
@@ -2582,7 +2582,7 @@ undo_time(
if (uhp == NULL || uhp->uh_walk != mark)
{
/* Need to redo more but can't find it... */
EMSG2(_(e_intern2), "undo_time()");
internal_error("undo_time()");
break;
}
}
@@ -2654,7 +2654,7 @@ u_undoredo(int undo)
#ifdef FEAT_AUTOCMD
unblock_autocmds();
#endif
EMSG(_("E438: u_undo: line numbers wrong"));
IEMSG(_("E438: u_undo: line numbers wrong"));
changed(); /* don't want UNCHANGED now */
return;
}
@@ -3234,7 +3234,7 @@ u_get_headentry(void)
{
if (curbuf->b_u_newhead == NULL || curbuf->b_u_newhead->uh_entry == NULL)
{
EMSG(_("E439: undo list corrupt"));
IEMSG(_("E439: undo list corrupt"));
return NULL;
}
return curbuf->b_u_newhead->uh_entry;
@@ -3266,7 +3266,7 @@ u_getbot(void)
uep->ue_bot = uep->ue_top + uep->ue_size + 1 + extra;
if (uep->ue_bot < 1 || uep->ue_bot > curbuf->b_ml.ml_line_count)
{
EMSG(_("E440: undo line missing"));
IEMSG(_("E440: undo line missing"));
uep->ue_bot = uep->ue_top + 1; /* assume all lines deleted, will
* get all the old lines back
* without deleting the current
+2 -2
View File
@@ -2771,7 +2771,7 @@ func_unref(char_u *name)
#ifdef EXITFREE
if (!entered_free_all_mem)
#endif
EMSG2(_(e_intern2), "func_unref()");
internal_error("func_unref()");
}
if (fp != NULL && --fp->uf_refcount <= 0)
{
@@ -2814,7 +2814,7 @@ func_ref(char_u *name)
else if (isdigit(*name))
/* Only give an error for a numbered function.
* Fail silently, when named or lambda function isn't found. */
EMSG2(_(e_intern2), "func_ref()");
internal_error("func_ref()");
}
/*
+8
View File
@@ -779,6 +779,14 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
75,
/**/
74,
/**/
73,
/**/
72,
/**/
71,
/**/
+3
View File
@@ -1626,6 +1626,9 @@ typedef UINT32_TYPEDEF UINT32_T;
#define EMSG3(s, p, q) emsg3((char_u *)(s), (char_u *)(p), (char_u *)(q))
#define EMSGN(s, n) emsgn((char_u *)(s), (long)(n))
#define EMSGU(s, n) emsgu((char_u *)(s), (long_u)(n))
#define IEMSG(s) iemsg((char_u *)(s))
#define IEMSG2(s, p) iemsg2((char_u *)(s), (char_u *)(p))
#define IEMSGN(s, n) iemsgn((char_u *)(s), (long)(n))
#define OUT_STR(s) out_str((char_u *)(s))
#define OUT_STR_NF(s) out_str_nf((char_u *)(s))
#define MSG_PUTS(s) msg_puts((char_u *)(s))
+7 -7
View File
@@ -791,7 +791,7 @@ win_split_ins(
oldwin = curwin;
/* add a status line when p_ls == 1 and splitting the first window */
if (lastwin == firstwin && p_ls == 1 && oldwin->w_status_height == 0)
if (ONE_WINDOW && p_ls == 1 && oldwin->w_status_height == 0)
{
if (oldwin->w_height <= p_wmh && new_wp == NULL)
{
@@ -1497,7 +1497,7 @@ win_exchange(long Prenum)
win_T *wp2;
int temp;
if (lastwin == firstwin) /* just one window */
if (ONE_WINDOW) /* just one window */
{
beep_flush();
return;
@@ -1679,7 +1679,7 @@ win_totop(int size, int flags)
int dir;
int height = curwin->w_height;
if (lastwin == firstwin)
if (ONE_WINDOW)
{
beep_flush();
return;
@@ -2128,7 +2128,7 @@ close_windows(
++RedrawingDisabled;
for (wp = firstwin; wp != NULL && lastwin != firstwin; )
for (wp = firstwin; wp != NULL && !ONE_WINDOW; )
{
if (wp->w_buffer == buf && (!keep_curwin || wp != curwin)
#ifdef FEAT_AUTOCMD
@@ -2543,7 +2543,7 @@ win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
;
if (ptp == NULL)
{
EMSG2(_(e_intern2), "win_close_othertab()");
internal_error("win_close_othertab()");
return;
}
ptp->tp_next = tp->tp_next;
@@ -3378,7 +3378,7 @@ close_others(
}
}
if (message && lastwin != firstwin)
if (message && !ONE_WINDOW)
EMSG(_("E445: Other window contains changes"));
}
@@ -5984,7 +5984,7 @@ last_status(
{
/* Don't make a difference between horizontal or vertical split. */
last_status_rec(topframe, (p_ls == 2
|| (p_ls == 1 && (morewin || lastwin != firstwin))));
|| (p_ls == 1 && (morewin || !ONE_WINDOW))));
}
static void