diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-01-30 13:04:42 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-30 13:04:42 +0000 |
commit | f2e30d0c448b9754d0d4daa901b51fbbf4c30747 (patch) | |
tree | 06e9f4c86a67ae8004ce6527cc0c7e2841e04c1a /src/insexpand.c | |
parent | 2a99fe6c41efcd5d1eb47823e7e73cf391e230ba (diff) | |
download | vim-git-f2e30d0c448b9754d0d4daa901b51fbbf4c30747.tar.gz |
patch 9.0.1262: the did_set_string_option function is too longv9.0.1262
Problem: The did_set_string_option function is too long.
Solution: Split off functionality to individual functions. (Yegappan
Lakshmanan, Lewis Russell, closes #11904)
Diffstat (limited to 'src/insexpand.c')
-rw-r--r-- | src/insexpand.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/insexpand.c b/src/insexpand.c index 2351ac65c..a8d986a2c 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -2545,16 +2545,15 @@ copy_global_to_buflocal_cb(callback_T *globcb, callback_T *bufcb) * name of a function (string), or function(<name>) or funcref(<name>) or a * lambda expression. */ - int + char * set_completefunc_option(void) { - int retval; + if (option_set_callback_func(curbuf->b_p_cfu, &cfu_cb) == FAIL) + return e_invalid_argument; - retval = option_set_callback_func(curbuf->b_p_cfu, &cfu_cb); - if (retval == OK) - set_buflocal_cfu_callback(curbuf); + set_buflocal_cfu_callback(curbuf); - return retval; + return NULL; } /* @@ -2575,16 +2574,14 @@ set_buflocal_cfu_callback(buf_T *buf UNUSED) * name of a function (string), or function(<name>) or funcref(<name>) or a * lambda expression. */ - int + char * set_omnifunc_option(void) { - int retval; + if (option_set_callback_func(curbuf->b_p_ofu, &ofu_cb) == FAIL) + return e_invalid_argument; - retval = option_set_callback_func(curbuf->b_p_ofu, &ofu_cb); - if (retval == OK) - set_buflocal_ofu_callback(curbuf); - - return retval; + set_buflocal_ofu_callback(curbuf); + return NULL; } /* @@ -2605,7 +2602,7 @@ set_buflocal_ofu_callback(buf_T *buf UNUSED) * name of a function (string), or function(<name>) or funcref(<name>) or a * lambda expression. */ - int + char * set_thesaurusfunc_option(void) { int retval; @@ -2622,7 +2619,7 @@ set_thesaurusfunc_option(void) retval = option_set_callback_func(p_tsrfu, &tsrfu_cb); } - return retval; + return retval == FAIL ? e_invalid_argument : NULL; } /* |