forked from aniani/vim
updated for version 7.3.320
Problem: When a 0xa0 character is in a sourced file the error message for unrecognized command does not show the problem. Solution: Display 0xa0 as <a0>.
This commit is contained in:
@@ -61,6 +61,7 @@ static char_u *do_one_cmd __ARGS((char_u **, int, struct condstack *, char_u *(*
|
|||||||
static char_u *do_one_cmd __ARGS((char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie));
|
static char_u *do_one_cmd __ARGS((char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie));
|
||||||
static int if_level = 0; /* depth in :if */
|
static int if_level = 0; /* depth in :if */
|
||||||
#endif
|
#endif
|
||||||
|
static void append_command __ARGS((char_u *cmd));
|
||||||
static char_u *find_command __ARGS((exarg_T *eap, int *full));
|
static char_u *find_command __ARGS((exarg_T *eap, int *full));
|
||||||
|
|
||||||
static void ex_abbreviate __ARGS((exarg_T *eap));
|
static void ex_abbreviate __ARGS((exarg_T *eap));
|
||||||
@@ -2136,10 +2137,7 @@ do_one_cmd(cmdlinep, sourcing,
|
|||||||
{
|
{
|
||||||
STRCPY(IObuff, _("E492: Not an editor command"));
|
STRCPY(IObuff, _("E492: Not an editor command"));
|
||||||
if (!sourcing)
|
if (!sourcing)
|
||||||
{
|
append_command(*cmdlinep);
|
||||||
STRCAT(IObuff, ": ");
|
|
||||||
STRNCAT(IObuff, *cmdlinep, 40);
|
|
||||||
}
|
|
||||||
errormsg = IObuff;
|
errormsg = IObuff;
|
||||||
}
|
}
|
||||||
goto doend;
|
goto doend;
|
||||||
@@ -2708,8 +2706,7 @@ doend:
|
|||||||
STRCPY(IObuff, errormsg);
|
STRCPY(IObuff, errormsg);
|
||||||
errormsg = IObuff;
|
errormsg = IObuff;
|
||||||
}
|
}
|
||||||
STRCAT(errormsg, ": ");
|
append_command(*cmdlinep);
|
||||||
STRNCAT(errormsg, *cmdlinep, IOSIZE - STRLEN(IObuff) - 1);
|
|
||||||
}
|
}
|
||||||
emsg(errormsg);
|
emsg(errormsg);
|
||||||
}
|
}
|
||||||
@@ -2796,6 +2793,42 @@ checkforcmd(pp, cmd, len)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Append "cmd" to the error message in IObuff.
|
||||||
|
* Takes care of limiting the length and handling 0xa0, which would be
|
||||||
|
* invisible otherwise.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
append_command(cmd)
|
||||||
|
char_u *cmd;
|
||||||
|
{
|
||||||
|
char_u *s = cmd;
|
||||||
|
char_u *d;
|
||||||
|
|
||||||
|
STRCAT(IObuff, ": ");
|
||||||
|
d = IObuff + STRLEN(IObuff);
|
||||||
|
while (*s != NUL && d - IObuff < IOSIZE - 7)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
|
enc_utf8 ? (s[0] == 0xc2 && s[1] == 0xa0) :
|
||||||
|
#endif
|
||||||
|
*s == 0xa0)
|
||||||
|
{
|
||||||
|
s +=
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
|
enc_utf8 ? 2 :
|
||||||
|
#endif
|
||||||
|
1;
|
||||||
|
STRCPY(d, "<a0>");
|
||||||
|
d += 4;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
MB_COPY_CHAR(s, d);
|
||||||
|
}
|
||||||
|
*d = NUL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find an Ex command by its name, either built-in or user.
|
* Find an Ex command by its name, either built-in or user.
|
||||||
* Start of the name can be found at eap->cmd.
|
* Start of the name can be found at eap->cmd.
|
||||||
|
@@ -709,6 +709,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
320,
|
||||||
/**/
|
/**/
|
||||||
319,
|
319,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user