diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-01-19 09:53:41 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2023-01-25 11:48:52 +0000 |
commit | 2a665736c18e2535e233e3d72bb29d4dc98a5bb4 (patch) | |
tree | 0fc610d8851dc03b3938e3b2ca677ba347652ac6 | |
parent | e93d9df4ec190783da2d42a7f3129338bd42f53a (diff) | |
download | rneovim-2a665736c18e2535e233e3d72bb29d4dc98a5bb4.tar.gz rneovim-2a665736c18e2535e233e3d72bb29d4dc98a5bb4.tar.bz2 rneovim-2a665736c18e2535e233e3d72bb29d4dc98a5bb4.zip |
refactor(optionstr.c): break up did_set_string_option 3
-rw-r--r-- | src/nvim/optionstr.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 5df122e443..fa26db5c12 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -679,6 +679,17 @@ static void did_set_breakindentopt(win_T *win, char **errmsg) } } +static void did_set_helpfile(void) +{ + // May compute new values for $VIM and $VIMRUNTIME + if (didset_vim) { + vim_unsetenv_ext("VIM"); + } + if (didset_vimruntime) { + vim_unsetenv_ext("VIMRUNTIME"); + } +} + /// Handle string options that need some action to perform when changed. /// The new value must be allocated. /// @@ -737,13 +748,7 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf errmsg = e_invarg; // error in value } } else if (varp == &p_hf) { // 'helpfile' - // May compute new values for $VIM and $VIMRUNTIME - if (didset_vim) { - vim_unsetenv_ext("VIM"); - } - if (didset_vimruntime) { - vim_unsetenv_ext("VIMRUNTIME"); - } + did_set_helpfile(); } else if (varp == &p_rtp || varp == &p_pp) { // 'runtimepath' 'packpath' runtime_search_path_invalidate(); } else if (varp == &curwin->w_p_culopt |