mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
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.
68452177ca
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user