diff options
Diffstat (limited to 'src/option.c')
-rw-r--r-- | src/option.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/option.c b/src/option.c index 459179e2e..d4e760b89 100644 --- a/src/option.c +++ b/src/option.c @@ -139,6 +139,9 @@ # define PV_LISP OPT_BUF(BV_LISP) # define PV_LW OPT_BOTH(OPT_BUF(BV_LW)) #endif +#ifdef FEAT_MBYTE +# define PV_MENC OPT_BOTH(OPT_BUF(BV_MENC)) +#endif #define PV_MA OPT_BUF(BV_MA) #define PV_ML OPT_BUF(BV_ML) #define PV_MOD OPT_BUF(BV_MOD) @@ -1900,6 +1903,15 @@ static struct vimoption options[] = {(char_u *)NULL, (char_u *)0L} #endif SCRIPTID_INIT}, + {"makeencoding","menc", P_STRING|P_VI_DEF, +#ifdef FEAT_MBYTE + (char_u *)&p_menc, PV_MENC, + {(char_u *)"", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"makeprg", "mp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #ifdef FEAT_QUICKFIX (char_u *)&p_mp, PV_MP, @@ -5686,6 +5698,9 @@ check_buf_options(buf_T *buf) check_string_option(&buf->b_p_lw); #endif check_string_option(&buf->b_p_bkc); +#ifdef FEAT_MBYTE + check_string_option(&buf->b_p_menc); +#endif } /* @@ -6289,8 +6304,9 @@ did_set_string_option( #endif #ifdef FEAT_MBYTE - /* 'encoding' and 'fileencoding' */ - else if (varp == &p_enc || gvarp == &p_fenc || varp == &p_tenc) + /* 'encoding', 'fileencoding', 'termencoding' and 'makeencoding' */ + else if (varp == &p_enc || gvarp == &p_fenc || varp == &p_tenc + || gvarp == &p_menc) { if (gvarp == &p_fenc) { @@ -10425,6 +10441,11 @@ unset_global_local_option(char_u *name, void *from) clear_string_option(&buf->b_p_lw); break; #endif +#ifdef FEAT_MBYTE + case PV_MENC: + clear_string_option(&buf->b_p_menc); + break; +#endif } } @@ -10478,6 +10499,9 @@ get_varp_scope(struct vimoption *p, int opt_flags) case PV_LW: return (char_u *)&(curbuf->b_p_lw); #endif case PV_BKC: return (char_u *)&(curbuf->b_p_bkc); +#ifdef FEAT_MBYTE + case PV_MENC: return (char_u *)&(curbuf->b_p_menc); +#endif } return NULL; /* "cannot happen" */ } @@ -10553,6 +10577,10 @@ get_varp(struct vimoption *p) case PV_LW: return *curbuf->b_p_lw != NUL ? (char_u *)&(curbuf->b_p_lw) : p->var; #endif +#ifdef FEAT_MBYTE + case PV_MENC: return *curbuf->b_p_menc != NUL + ? (char_u *)&(curbuf->b_p_menc) : p->var; +#endif #ifdef FEAT_ARABIC case PV_ARAB: return (char_u *)&(curwin->w_p_arab); @@ -11154,6 +11182,9 @@ buf_copy_options(buf_T *buf, int flags) #ifdef FEAT_LISP buf->b_p_lw = empty_option; #endif +#ifdef FEAT_MBYTE + buf->b_p_menc = empty_option; +#endif /* * Don't copy the options set by ex_help(), use the saved values, |