diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-01-23 10:04:36 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2023-01-25 11:48:52 +0000 |
commit | 0522dc35af3d9159300e64bea120000a7a26d044 (patch) | |
tree | 6cd840155e5e3249b029063569ab39f68a1a7eba | |
parent | 59746d228e5a7dc90e39c3a3bd2917adb21c4f08 (diff) | |
download | rneovim-0522dc35af3d9159300e64bea120000a7a26d044.tar.gz rneovim-0522dc35af3d9159300e64bea120000a7a26d044.tar.bz2 rneovim-0522dc35af3d9159300e64bea120000a7a26d044.zip |
refactor(optionstr.c): break up did_set_string_option 31
-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 6a1a41e831..b13389aa65 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -704,6 +704,13 @@ static void did_set_helplang(char **errmsg) } } +static void did_set_highlight(char **varp, char **errmsg) +{ + if (strcmp(*varp, HIGHLIGHT_INIT) != 0) { + *errmsg = e_unsupportedoption; + } +} + static void did_set_background(char **errmsg) { if (check_opt_strings(p_bg, p_bg_values, false) != OK) { @@ -1383,9 +1390,7 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf } else if (varp == &p_hlg) { // 'helplang' did_set_helplang(&errmsg); } else if (varp == &p_hl) { // 'highlight' - if (strcmp(*varp, HIGHLIGHT_INIT) != 0) { - errmsg = e_unsupportedoption; - } + did_set_highlight(varp, &errmsg); } else if (varp == &p_jop) { // 'jumpoptions' if (opt_strings_flags(p_jop, p_jop_values, &jop_flags, true) != OK) { errmsg = e_invarg; |