diff options
Diffstat (limited to 'src/nvim/eval/vars.c')
-rw-r--r-- | src/nvim/eval/vars.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index 0e0088bfad..a8358aab51 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -34,6 +34,7 @@ #include "nvim/globals.h" #include "nvim/hashtab.h" #include "nvim/macros_defs.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/ops.h" @@ -1412,7 +1413,7 @@ static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t msg_start(); msg_puts(prefix); if (name != NULL) { // "a:" vars don't have a name stored - msg_puts_len(name, name_len, 0); + msg_puts_len(name, name_len, 0, false); } msg_putchar(' '); msg_advance(22); @@ -1434,7 +1435,7 @@ static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t msg_putchar(' '); } - msg_outtrans(string, 0); + msg_outtrans(string, 0, false); if (type == VAR_FUNC || type == VAR_PARTIAL) { msg_puts("()"); @@ -1913,7 +1914,7 @@ static OptVal tv_to_optval(typval_T *tv, OptIndex opt_idx, const char *option, b const bool option_has_num = !is_tty_opt && option_has_type(opt_idx, kOptValTypeNumber); const bool option_has_str = is_tty_opt || option_has_type(opt_idx, kOptValTypeString); - if (!is_tty_opt && (get_option(opt_idx)->flags & P_FUNC) && tv_is_func(*tv)) { + if (!is_tty_opt && (get_option(opt_idx)->flags & kOptFlagFunc) && tv_is_func(*tv)) { // If the option can be set to a function reference or a lambda // and the passed value is a function reference, then convert it to // the name (string) of the function reference. @@ -1970,14 +1971,12 @@ typval_T optval_as_tv(OptVal value, bool numbool) case kOptValTypeNil: break; case kOptValTypeBoolean: - if (value.data.boolean != kNone) { - if (numbool) { - rettv.v_type = VAR_NUMBER; - rettv.vval.v_number = value.data.boolean == kTrue; - } else { - rettv.v_type = VAR_BOOL; - rettv.vval.v_bool = value.data.boolean == kTrue; - } + if (numbool) { + rettv.v_type = VAR_NUMBER; + rettv.vval.v_number = value.data.boolean; + } else if (value.data.boolean != kNone) { + rettv.v_type = VAR_BOOL; + rettv.vval.v_bool = value.data.boolean == kTrue; } break; // return v:null for None boolean value. case kOptValTypeNumber: |