mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
patch 8.0.0211: cannot build without the multi-byte feature
Problem: Build fails if the multi-byte feature is disabled. Solution: Change #ifdef around ins_char_bytes.
This commit is contained in:
12
src/misc1.c
12
src/misc1.c
@@ -2177,16 +2177,19 @@ ins_bytes_len(char_u *p, int len)
|
|||||||
void
|
void
|
||||||
ins_char(int c)
|
ins_char(int c)
|
||||||
{
|
{
|
||||||
#if defined(FEAT_MBYTE) || defined(PROTO)
|
|
||||||
char_u buf[MB_MAXBYTES + 1];
|
char_u buf[MB_MAXBYTES + 1];
|
||||||
int n;
|
int n = 1;
|
||||||
|
|
||||||
|
#if defined(FEAT_MBYTE) || defined(PROTO)
|
||||||
n = (*mb_char2bytes)(c, buf);
|
n = (*mb_char2bytes)(c, buf);
|
||||||
|
|
||||||
/* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
|
/* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
|
||||||
* Happens for CTRL-Vu9900. */
|
* Happens for CTRL-Vu9900. */
|
||||||
if (buf[0] == 0)
|
if (buf[0] == 0)
|
||||||
buf[0] = '\n';
|
buf[0] = '\n';
|
||||||
|
#else
|
||||||
|
buf[0] = c;
|
||||||
|
#endif
|
||||||
|
|
||||||
ins_char_bytes(buf, n);
|
ins_char_bytes(buf, n);
|
||||||
}
|
}
|
||||||
@@ -2195,7 +2198,6 @@ ins_char(int c)
|
|||||||
ins_char_bytes(char_u *buf, int charlen)
|
ins_char_bytes(char_u *buf, int charlen)
|
||||||
{
|
{
|
||||||
int c = buf[0];
|
int c = buf[0];
|
||||||
#endif
|
|
||||||
int newlen; /* nr of bytes inserted */
|
int newlen; /* nr of bytes inserted */
|
||||||
int oldlen; /* nr of bytes deleted (0 when not replacing) */
|
int oldlen; /* nr of bytes deleted (0 when not replacing) */
|
||||||
char_u *p;
|
char_u *p;
|
||||||
@@ -2218,11 +2220,7 @@ ins_char_bytes(char_u *buf, int charlen)
|
|||||||
|
|
||||||
/* The lengths default to the values for when not replacing. */
|
/* The lengths default to the values for when not replacing. */
|
||||||
oldlen = 0;
|
oldlen = 0;
|
||||||
#ifdef FEAT_MBYTE
|
|
||||||
newlen = charlen;
|
newlen = charlen;
|
||||||
#else
|
|
||||||
newlen = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (State & REPLACE_FLAG)
|
if (State & REPLACE_FLAG)
|
||||||
{
|
{
|
||||||
|
@@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
211,
|
||||||
/**/
|
/**/
|
||||||
210,
|
210,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user