0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.1.0805: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_MBYTE, part 1.
This commit is contained in:
Bram Moolenaar
2019-01-24 15:04:48 +01:00
parent 4b9e91f0ba
commit 135059724f
17 changed files with 234 additions and 1147 deletions

View File

@@ -1957,7 +1957,7 @@ script_dump_profile(FILE *fd)
if (IObuff[IOSIZE - 2] != NUL && IObuff[IOSIZE - 2] != NL)
{
int n = IOSIZE - 2;
# ifdef FEAT_MBYTE
if (enc_utf8)
{
/* Move to the first byte of this char.
@@ -1968,7 +1968,6 @@ script_dump_profile(FILE *fd)
}
else if (has_mbyte)
n -= mb_head_off(IObuff, IObuff + n);
# endif
IObuff[n] = NL;
IObuff[n + 1] = NUL;
}
@@ -4254,9 +4253,7 @@ struct source_cookie
int dbg_tick; /* debug_tick when breakpoint was set */
int level; /* top nesting level of sourced file */
#endif
#ifdef FEAT_MBYTE
vimconv_T conv; /* type of conversion */
#endif
};
#ifdef FEAT_EVAL
@@ -4593,7 +4590,6 @@ do_source(
# endif
#endif
#ifdef FEAT_MBYTE
cookie.conv.vc_type = CONV_NONE; /* no conversion */
/* Read the first line so we can check for a UTF-8 BOM. */
@@ -4612,7 +4608,6 @@ do_source(
firstline = p;
}
}
#endif
/*
* Call do_cmdline, which will call getsourceline() to get the lines.
@@ -4683,9 +4678,7 @@ almosttheend:
fclose(cookie.fp);
vim_free(cookie.nextline);
vim_free(firstline);
#ifdef FEAT_MBYTE
convert_setup(&cookie.conv, NULL, NULL);
#endif
if (trigger_source_post)
apply_autocmds(EVENT_SOURCEPOST, fname_exp, fname_exp, FALSE, curbuf);
@@ -4924,7 +4917,6 @@ getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
}
}
#ifdef FEAT_MBYTE
if (line != NULL && sp->conv.vc_type != CONV_NONE)
{
char_u *s;
@@ -4937,7 +4929,6 @@ getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
line = s;
}
}
#endif
#ifdef FEAT_EVAL
/* Did we encounter a breakpoint? */
@@ -5194,7 +5185,6 @@ script_line_end(void)
void
ex_scriptencoding(exarg_T *eap UNUSED)
{
#ifdef FEAT_MBYTE
struct source_cookie *sp;
char_u *name;
@@ -5219,7 +5209,6 @@ ex_scriptencoding(exarg_T *eap UNUSED)
if (name != eap->arg)
vim_free(name);
#endif
}
#if defined(FEAT_EVAL) || defined(PROTO)