diff options
Diffstat (limited to 'src/nvim/option.c')
| -rw-r--r-- | src/nvim/option.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 016a50fb62..3f12709521 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1746,7 +1746,7 @@ static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL}; static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL}; static char *(p_ead_values[]) = {"both", "ver", "hor", NULL}; static char *(p_buftype_values[]) = -{"nofile", "nowrite", "quickfix", "help", "acwrite", NULL}; +{"nofile", "nowrite", "quickfix", "help", "acwrite", "terminal", NULL}; static char *(p_bufhidden_values[]) = {"hide", "unload", "delete", "wipe", NULL}; static char *(p_bs_values[]) = {"indent", "eol", "start", NULL}; static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax", @@ -3748,7 +3748,7 @@ did_set_string_option ( /* 'encoding' and 'fileencoding' */ else if (varp == &p_enc || gvarp == &p_fenc || varp == &p_tenc) { if (gvarp == &p_fenc) { - if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL) + if (!MODIFIABLE(curbuf) && opt_flags != OPT_GLOBAL) errmsg = e_modifiable; else if (vim_strchr(*varp, ',') != NULL) /* No comma allowed in 'fileencoding'; catches confusing it @@ -3819,7 +3819,7 @@ did_set_string_option ( } /* 'fileformat' */ else if (gvarp == &p_ff) { - if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL)) + if (!MODIFIABLE(curbuf) && !(opt_flags & OPT_GLOBAL)) errmsg = e_modifiable; else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK) errmsg = e_invarg; @@ -4097,9 +4097,11 @@ did_set_string_option ( } /* When 'buftype' is set, check for valid value. */ else if (gvarp == &p_bt) { - if (check_opt_strings(curbuf->b_p_bt, p_buftype_values, FALSE) != OK) + if ((curbuf->terminal && curbuf->b_p_bt[0] != 't') + || (!curbuf->terminal && curbuf->b_p_bt[0] == 't') + || check_opt_strings(curbuf->b_p_bt, p_buftype_values, FALSE) != OK) { errmsg = e_invarg; - else { + } else { if (curwin->w_status_height) { curwin->w_redr_status = TRUE; redraw_later(VALID); |
