diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-24 14:36:20 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-02-28 13:28:24 +0800 |
commit | adfa55ba99febaa1eb5ebe1800ec5f94c4b4b664 (patch) | |
tree | 3a9bf2c894e1a0924aee1dc39f19cb01fdd31366 /src/nvim/eval.c | |
parent | 9a271f6afd7a9b1c17d694b57ee1f489496000aa (diff) | |
download | rneovim-adfa55ba99febaa1eb5ebe1800ec5f94c4b4b664.tar.gz rneovim-adfa55ba99febaa1eb5ebe1800ec5f94c4b4b664.tar.bz2 rneovim-adfa55ba99febaa1eb5ebe1800ec5f94c4b4b664.zip |
vim-patch:8.2.2757: Vim9: blob tests for legacy and Vim9 script are separate
Problem: Vim9: blob tests for legacy and Vim9 script are separate.
Solution: Add CheckLegacyAndVim9Success(). Make blob index assign work.
https://github.com/vim/vim/commit/68452177ca4cda4a9d5f93892e437447cf9404c8
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 841588d4c3..ebd13034d7 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -1620,17 +1620,9 @@ void set_var_lval(lval_T *lp, char *endp, typval_T *rettv, int copy, const bool lp->ll_n2 = tv_blob_len(lp->ll_blob) - 1; } - if (lp->ll_n2 - lp->ll_n1 + 1 != tv_blob_len(rettv->vval.v_blob)) { - emsg(_("E972: Blob value does not have the right number of bytes")); + if (tv_blob_set_range(lp->ll_blob, lp->ll_n1, lp->ll_n2, rettv) == FAIL) { return; } - if (lp->ll_empty2) { - lp->ll_n2 = tv_blob_len(lp->ll_blob); - } - - for (int il = (int)lp->ll_n1, ir = 0; il <= (int)lp->ll_n2; il++) { - tv_blob_set(lp->ll_blob, il, tv_blob_get(rettv->vval.v_blob, ir++)); - } } else { bool error = false; const char val = (char)tv_get_number_chk(rettv, &error); |