diff options
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 9b4cd0924b..392a2f3908 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -247,7 +247,7 @@ typedef struct vimoption { "8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText," \ "d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr," \ "N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title," \ - "v:Visual,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn," \ + "v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn," \ "A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal," \ "B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel," \ "x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill," \ @@ -341,7 +341,7 @@ static inline size_t compute_double_colon_len(const char *const val, do { size_t dir_len; const char *dir; - iter = vim_colon_env_iter(val, iter, &dir, &dir_len); + iter = vim_env_iter(':', val, iter, &dir, &dir_len); if (dir != NULL && dir_len > 0) { ret += ((dir_len + memcnt(dir, ',', dir_len) + common_suf_len + !after_pathsep(dir, dir + dir_len)) * 2 @@ -385,8 +385,8 @@ static inline char *add_colon_dirs(char *dest, const char *const val, do { size_t dir_len; const char *dir; - iter = (forward ? vim_colon_env_iter : vim_colon_env_iter_rev)( - val, iter, &dir, &dir_len); + iter = (forward ? vim_env_iter : vim_env_iter_rev)(':', val, iter, &dir, + &dir_len); if (dir != NULL && dir_len > 0) { dest = strcpy_comma_escaped(dest, dir, dir_len); if (!after_pathsep(dest - 1, dest)) { @@ -2124,7 +2124,7 @@ static void didset_options(void) static void didset_options2(void) { // Initialize the highlight_attr[] table. - (void)highlight_changed(); + highlight_changed(); // Parse default for 'clipboard'. (void)opt_strings_flags(p_cb, p_cb_values, &cb_flags, true); @@ -2538,11 +2538,11 @@ did_set_string_option ( if (s[2] == NUL) break; } - } - /* 'highlight' */ - else if (varp == &p_hl) { - if (highlight_changed() == FAIL) - errmsg = e_invarg; /* invalid flags */ + } else if (varp == &p_hl) { + // 'highlight' + if (strcmp((char *)(*varp), HIGHLIGHT_INIT) != 0) { + errmsg = e_unsupportedoption; + } } /* 'nrformats' */ else if (gvarp == &p_nf) { @@ -2639,7 +2639,7 @@ did_set_string_option ( if (varp == &p_enc) { // only encoding=utf-8 allowed if (STRCMP(p_enc, "utf-8") != 0) { - errmsg = e_invarg; + errmsg = e_unsupportedoption; } } } @@ -3207,8 +3207,6 @@ did_set_string_option ( */ if (did_chartab) (void)init_chartab(); - if (varp == &p_hl) - (void)highlight_changed(); } else { /* Remember where the option was set. */ set_option_scriptID_idx(opt_idx, opt_flags, current_SID); @@ -4827,17 +4825,6 @@ char *set_option_value(const char *const name, const long number, return NULL; } -char_u *get_highlight_default(void) -{ - int i; - - i = findoption("hl"); - if (i >= 0) { - return options[i].def_val[VI_DEFAULT]; - } - return (char_u *)NULL; -} - /* * Translate a string like "t_xx", "<t_xx>" or "<S-Tab>" to a key number. */ |