mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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.
This commit is contained in:
15
src/eval.c
15
src/eval.c
@@ -1319,23 +1319,12 @@ set_var_lval(
|
||||
|
||||
if (lp->ll_range && rettv->v_type == VAR_BLOB)
|
||||
{
|
||||
int il, ir;
|
||||
|
||||
if (lp->ll_empty2)
|
||||
lp->ll_n2 = blob_len(lp->ll_blob) - 1;
|
||||
|
||||
if (lp->ll_n2 - lp->ll_n1 + 1 != blob_len(rettv->vval.v_blob))
|
||||
{
|
||||
emsg(_("E972: Blob value does not have the right number of bytes"));
|
||||
if (blob_set_range(lp->ll_blob, lp->ll_n1, lp->ll_n2,
|
||||
rettv) == FAIL)
|
||||
return;
|
||||
}
|
||||
if (lp->ll_empty2)
|
||||
lp->ll_n2 = blob_len(lp->ll_blob);
|
||||
|
||||
ir = 0;
|
||||
for (il = lp->ll_n1; il <= lp->ll_n2; il++)
|
||||
blob_set(lp->ll_blob, il,
|
||||
blob_get(rettv->vval.v_blob, ir++));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user