From d8df9afad62a9a4beb4ec607f8e10d674de66dbe Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Jul 2022 18:11:37 +0800 Subject: vim-patch:8.2.2969: subtracting from number option fails when result is zero Problem: Subtracting from number option fails when result is zero. (Ingo Karkat) Solution: Reset the string value when using the numeric value. (closes vim/vim#8351) https://github.com/vim/vim/commit/a42e6e0082a6d564dbfa55317d4a698ac12ae898 Cherry-pick Test_compound_assignment_operators() changes from patch 8.2.1593 --- src/nvim/eval/vars.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/eval/vars.c') diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index a0141402bc..152d1c3e00 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -663,6 +663,7 @@ static char *ex_let_one(char *arg, typval_T *const tv, const bool copy, const bo case '%': n = num_modulus(numval, n); break; } + s = NULL; } else if (opt_type == gov_string && stringval != NULL && s != NULL) { // string char *const oldstringval = stringval; -- cgit