diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-01-23 10:15:59 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2023-01-25 11:48:52 +0000 |
commit | 2a83a5077d19a3a101b3653569928c681848e2ca (patch) | |
tree | c8d7d7507019db9a3e155dca62418922d4d42d74 /src | |
parent | a84bc3817a4f2ae77e2ac9de4b7e7d8464311feb (diff) | |
download | rneovim-2a83a5077d19a3a101b3653569928c681848e2ca.tar.gz rneovim-2a83a5077d19a3a101b3653569928c681848e2ca.tar.bz2 rneovim-2a83a5077d19a3a101b3653569928c681848e2ca.zip |
refactor(optionstr.c): break up did_set_string_option 41
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/optionstr.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 7161768ad6..5ce39ec3a4 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -698,6 +698,13 @@ static void did_set_helpfile(void) } } +static void did_set_cursorlineopt(win_T *win, char **varp, char **errmsg) +{ + if (**varp == NUL || fill_culopt_flags(*varp, win) != OK) { + *errmsg = e_invarg; + } +} + static void did_set_helplang(char **errmsg) { // Check for "", "ab", "ab,cd", etc. @@ -1457,9 +1464,7 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf runtime_search_path_invalidate(); } else if (varp == &curwin->w_p_culopt || gvarp == &curwin->w_allbuf_opt.wo_culopt) { // 'cursorlineopt' - if (**varp == NUL || fill_culopt_flags(*varp, curwin) != OK) { - errmsg = e_invarg; - } + did_set_cursorlineopt(curwin, varp, &errmsg); } else if (varp == &curwin->w_p_cc) { // 'colorcolumn' errmsg = check_colorcolumn(curwin); } else if (varp == &p_hlg) { // 'helplang' |