mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
refactor(optionstr.c): break up did_set_string_option 27
This commit is contained in:
@@ -966,6 +966,20 @@ static void did_set_shada(vimoption_T **opt, int *opt_idx, bool *free_oldval, ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void did_set_titleiconstring(char **varp)
|
||||||
|
{
|
||||||
|
// 'titlestring' and 'iconstring'
|
||||||
|
int flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON;
|
||||||
|
|
||||||
|
// NULL => statusline syntax
|
||||||
|
if (vim_strchr(*varp, '%') && check_stl_option(*varp) == NULL) {
|
||||||
|
stl_syntax |= flagval;
|
||||||
|
} else {
|
||||||
|
stl_syntax &= ~flagval;
|
||||||
|
}
|
||||||
|
did_set_title();
|
||||||
|
}
|
||||||
|
|
||||||
static void did_set_buftype(buf_T *buf, win_T *win, char **errmsg)
|
static void did_set_buftype(buf_T *buf, win_T *win, char **errmsg)
|
||||||
{
|
{
|
||||||
// When 'buftype' is set, check for valid value.
|
// When 'buftype' is set, check for valid value.
|
||||||
@@ -1446,15 +1460,7 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf
|
|||||||
fill_breakat_flags();
|
fill_breakat_flags();
|
||||||
} else if (varp == &p_titlestring || varp == &p_iconstring) {
|
} else if (varp == &p_titlestring || varp == &p_iconstring) {
|
||||||
// 'titlestring' and 'iconstring'
|
// 'titlestring' and 'iconstring'
|
||||||
int flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON;
|
did_set_titleiconstring(varp);
|
||||||
|
|
||||||
// NULL => statusline syntax
|
|
||||||
if (vim_strchr(*varp, '%') && check_stl_option(*varp) == NULL) {
|
|
||||||
stl_syntax |= flagval;
|
|
||||||
} else {
|
|
||||||
stl_syntax &= ~flagval;
|
|
||||||
}
|
|
||||||
did_set_title();
|
|
||||||
} else if (varp == &p_sel) { // 'selection'
|
} else if (varp == &p_sel) { // 'selection'
|
||||||
if (*p_sel == NUL
|
if (*p_sel == NUL
|
||||||
|| check_opt_strings(p_sel, p_sel_values, false) != OK) {
|
|| check_opt_strings(p_sel, p_sel_values, false) != OK) {
|
||||||
|
Reference in New Issue
Block a user