mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.0743: giving error messages is not flexible
Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes #3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts.
This commit is contained in:
22
src/edit.c
22
src/edit.c
@@ -360,7 +360,7 @@ edit(
|
||||
/* Don't allow inserting in the sandbox. */
|
||||
if (sandbox != 0)
|
||||
{
|
||||
EMSG(_(e_sandbox));
|
||||
emsg(_(e_sandbox));
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
@@ -368,7 +368,7 @@ edit(
|
||||
* caller of getcmdline() may get confused. */
|
||||
if (textlock != 0)
|
||||
{
|
||||
EMSG(_(e_secure));
|
||||
emsg(_(e_secure));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ edit(
|
||||
/* Don't allow recursive insert mode when busy with completion. */
|
||||
if (compl_started || compl_busy || pum_visible())
|
||||
{
|
||||
EMSG(_(e_secure));
|
||||
emsg(_(e_secure));
|
||||
return FALSE;
|
||||
}
|
||||
ins_compl_clear(); /* clear stuff for CTRL-X mode */
|
||||
@@ -476,7 +476,7 @@ edit(
|
||||
if (p_fkmap && p_ri)
|
||||
{
|
||||
beep_flush();
|
||||
EMSG(farsi_text_3); /* encoded in Farsi */
|
||||
emsg(farsi_text_3); /* encoded in Farsi */
|
||||
State = INSERT;
|
||||
}
|
||||
else
|
||||
@@ -4262,14 +4262,14 @@ expand_by_function(
|
||||
|
||||
if (curwin_save != curwin || curbuf_save != curbuf)
|
||||
{
|
||||
EMSG(_(e_complwin));
|
||||
emsg(_(e_complwin));
|
||||
goto theend;
|
||||
}
|
||||
curwin->w_cursor = pos; /* restore the cursor position */
|
||||
validate_cursor();
|
||||
if (!EQUAL_POS(curwin->w_cursor, pos))
|
||||
{
|
||||
EMSG(_(e_compldel));
|
||||
emsg(_(e_compldel));
|
||||
goto theend;
|
||||
}
|
||||
|
||||
@@ -5567,7 +5567,7 @@ ins_complete(int c, int enable_pum)
|
||||
? curbuf->b_p_cfu : curbuf->b_p_ofu;
|
||||
if (*funcname == NUL)
|
||||
{
|
||||
EMSG2(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION
|
||||
semsg(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION
|
||||
? "completefunc" : "omnifunc");
|
||||
/* restore did_ai, so that adding comment leader works */
|
||||
did_ai = save_did_ai;
|
||||
@@ -5587,14 +5587,14 @@ ins_complete(int c, int enable_pum)
|
||||
State = save_State;
|
||||
if (curwin_save != curwin || curbuf_save != curbuf)
|
||||
{
|
||||
EMSG(_(e_complwin));
|
||||
emsg(_(e_complwin));
|
||||
return FAIL;
|
||||
}
|
||||
curwin->w_cursor = pos; /* restore the cursor position */
|
||||
validate_cursor();
|
||||
if (!EQUAL_POS(curwin->w_cursor, pos))
|
||||
{
|
||||
EMSG(_(e_compldel));
|
||||
emsg(_(e_compldel));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -7678,7 +7678,7 @@ stuff_inserted(
|
||||
ptr = get_last_insert();
|
||||
if (ptr == NULL)
|
||||
{
|
||||
EMSG(_(e_noinstext));
|
||||
emsg(_(e_noinstext));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -8969,7 +8969,7 @@ ins_insert(int replaceState)
|
||||
if (p_fkmap && p_ri)
|
||||
{
|
||||
beep_flush();
|
||||
EMSG(farsi_text_3); /* encoded in Farsi */
|
||||
emsg(farsi_text_3); /* encoded in Farsi */
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user