1
0
forked from aniani/vim

patch 8.2.1866: Vim9: appending to pushed blob gives wrong result

Problem:    Vim9: appending to pushed blob gives wrong result.
Solution:   Set ga_maxlen when copying a blob.
This commit is contained in:
Bram Moolenaar
2020-10-19 20:21:03 +02:00
parent 1dcae59957
commit 66fa5fd54f
3 changed files with 9 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ blob_copy(blob_T *from, typval_T *to)
len = 0; len = 0;
} }
to->vval.v_blob->bv_ga.ga_len = len; to->vval.v_blob->bv_ga.ga_len = len;
to->vval.v_blob->bv_ga.ga_maxlen = len;
} }
return ret; return ret;
} }

View File

@@ -1790,6 +1790,12 @@ def Test_list_add()
CheckDefExecFailure(lines, 'E1130:', 2) CheckDefExecFailure(lines, 'E1130:', 2)
enddef enddef
def Test_blob_add()
var b: blob = 0z12
add(b, 0x34)
assert_equal(0z1234, b)
enddef
def SID(): number def SID(): number
return expand('<SID>') return expand('<SID>')
->matchstr('<SNR>\zs\d\+\ze_$') ->matchstr('<SNR>\zs\d\+\ze_$')

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1866,
/**/ /**/
1865, 1865,
/**/ /**/