neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 18c37c616ec521bb79271c0b51fa198d9f664540
parent 9679d058d42c22179fe3cf56e97983b2e67fb3f3
Author: Lewis Russell <lewis6991@gmail.com>
Date:   Wed, 25 Jan 2023 14:38:07 +0000

refactor(option.c): factor out common skip check

Diffstat:
Msrc/nvim/option.c | 13++++---------
1 file changed, 4 insertions(+), 9 deletions(-)

diff --git 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); }