diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-01-25 14:38:07 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2023-01-26 09:52:22 +0000 |
commit | 18c37c616ec521bb79271c0b51fa198d9f664540 (patch) | |
tree | 845de2b8a6313d8b0eb071cf42c8a59e9b22f094 /src/nvim/option.c | |
parent | 9679d058d42c22179fe3cf56e97983b2e67fb3f3 (diff) | |
download | rneovim-18c37c616ec521bb79271c0b51fa198d9f664540.tar.gz rneovim-18c37c616ec521bb79271c0b51fa198d9f664540.tar.bz2 rneovim-18c37c616ec521bb79271c0b51fa198d9f664540.zip |
refactor(option.c): factor out common skip check
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 84bc72e834..d1ecfa0dd7 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1410,9 +1410,6 @@ int do_set(char *arg, int opt_flags) int value_checked = false; if (flags & P_BOOL) { // boolean do_set_bool(opt_idx, opt_flags, prefix, nextchar, afterchar, varp, &errmsg); - if (errmsg != NULL) { - goto skip; - } } else { // Numeric or string. if (vim_strchr("=:&<", (uint8_t)nextchar) == NULL || prefix != 1) { @@ -1423,21 +1420,19 @@ int do_set(char *arg, int opt_flags) if (flags & P_NUM) { // numeric do_set_num(opt_idx, opt_flags, &arg, nextchar, op, varp, errbuf, sizeof(errbuf), &errmsg); - if (errmsg != NULL) { - goto skip; - } } else if (opt_idx >= 0) { // String. do_set_string(opt_idx, opt_flags, &arg, nextchar, op, flags, varp, errbuf, sizeof(errbuf), &value_checked, &errmsg); - if (errmsg != NULL) { - goto skip; - } } else { // key code option(FIXME(tarruda): Show a warning or something // similar) } } + if (errmsg != NULL) { + goto skip; + } + if (opt_idx >= 0) { did_set_option(opt_idx, opt_flags, op == OP_NONE, value_checked); } |