diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-14 08:29:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 08:29:05 +0800 |
commit | 20c9f4b3521fa7ab5c5997c0ec1a3df2b5bd0dbe (patch) | |
tree | 092e42d145c081172935e256f5fef7b429c3dfc2 /src/nvim/optionstr.c | |
parent | fc9ece617bbf5fbdc74eed33c63641c550b4b314 (diff) | |
download | rneovim-20c9f4b3521fa7ab5c5997c0ec1a3df2b5bd0dbe.tar.gz rneovim-20c9f4b3521fa7ab5c5997c0ec1a3df2b5bd0dbe.tar.bz2 rneovim-20c9f4b3521fa7ab5c5997c0ec1a3df2b5bd0dbe.zip |
vim-patch:9.0.1307: setting 'formatoptions' with :let doesn't check for errors (#22252)
Problem: Setting 'formatoptions' with :let doesn't check for errors.
Solution: Pass "errbuf" to set_string_option(). (Yegappan Lakshmanan,
closes vim/vim#11974, closes vim/vim#11972)
https://github.com/vim/vim/commit/32ff96ef018eb1a5bea0953648b4892a6ee71658
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/optionstr.c')
-rw-r--r-- | src/nvim/optionstr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 5f8514b1a6..f903ad3d09 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -410,7 +410,8 @@ void set_string_option_direct_in_win(win_T *wp, const char *name, int opt_idx, c /// #OPT_GLOBAL. /// /// @return NULL on success, an untranslated error message on error. -char *set_string_option(const int opt_idx, const char *const value, const int opt_flags) +char *set_string_option(const int opt_idx, const char *const value, const int opt_flags, + char *const errbuf, const size_t errbuflen) FUNC_ATTR_NONNULL_ARG(2) FUNC_ATTR_WARN_UNUSED_RESULT { vimoption_T *opt = get_option(opt_idx); @@ -442,7 +443,7 @@ char *set_string_option(const int opt_idx, const char *const value, const int op int value_checked = false; char *const errmsg = did_set_string_option(opt_idx, varp, oldval, - NULL, 0, + errbuf, errbuflen, opt_flags, &value_checked); if (errmsg == NULL) { did_set_option(opt_idx, opt_flags, true, value_checked); |