diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-25 18:11:37 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-25 18:20:47 +0800 |
commit | d8df9afad62a9a4beb4ec607f8e10d674de66dbe (patch) | |
tree | 1e3f04eddbdc728eee58f2356ea98bf2bc1e412c /src/nvim/eval/vars.c | |
parent | 963ea726daf3e19279f8e24b48116f11f1921c7d (diff) | |
download | rneovim-d8df9afad62a9a4beb4ec607f8e10d674de66dbe.tar.gz rneovim-d8df9afad62a9a4beb4ec607f8e10d674de66dbe.tar.bz2 rneovim-d8df9afad62a9a4beb4ec607f8e10d674de66dbe.zip |
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
Diffstat (limited to 'src/nvim/eval/vars.c')
-rw-r--r-- | src/nvim/eval/vars.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |