aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-03-25 22:08:14 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-25 22:08:14 -0300
commita6e53a3797a93fe060f807fe2e4c6361854b6c97 (patch)
treeb684785ba9c769491e6ebdac8e21495cf22dbdd3 /src/nvim/option.c
parentd2d99454e63c0e6649fddd52bbd9a10d27c2e347 (diff)
parent2aa2513b8e023a0d7bd2071299f0ea59a4d4ce25 (diff)
downloadrneovim-a6e53a3797a93fe060f807fe2e4c6361854b6c97.tar.gz
rneovim-a6e53a3797a93fe060f807fe2e4c6361854b6c97.tar.bz2
rneovim-a6e53a3797a93fe060f807fe2e4c6361854b6c97.zip
Merge PR #2076 'Builtin terminal emulation'
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c12
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);