aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/optionstr.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index 48e4f2c6b2..6a1a41e831 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -1165,8 +1165,8 @@ static void did_set_virtualedit(win_T *win, int opt_flags, char *oldval, char **
}
}
-static void did_set_syntax(char **varp, char *oldval, int *value_checked, bool *value_changed,
- char **errmsg)
+static void did_set_filetype_or_syntax(char **varp, char *oldval, int *value_checked,
+ bool *value_changed, char **errmsg)
{
if (!valid_filetype(*varp)) {
*errmsg = e_invarg;
@@ -1664,18 +1664,8 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf
if (check_opt_strings(p_icm, p_icm_values, false) != OK) {
errmsg = e_invarg;
}
- } else if (gvarp == &p_ft) {
- if (!valid_filetype(*varp)) {
- errmsg = e_invarg;
- } else {
- value_changed = strcmp(oldval, *varp) != 0;
-
- // Since we check the value, there is no need to set P_INSECURE,
- // even when the value comes from a modeline.
- *value_checked = true;
- }
- } else if (gvarp == &p_syn) {
- did_set_syntax(varp, oldval, value_checked, &value_changed, &errmsg);
+ } else if (gvarp == &p_ft || gvarp == &p_syn) {
+ did_set_filetype_or_syntax(varp, oldval, value_checked, &value_changed, &errmsg);
} else if (varp == &curwin->w_p_winhl) {
if (!parse_winhl_opt(curwin)) {
errmsg = e_invarg;