doc(eval): include latest relevant Blob changes

Also includes some small relevant nearby non-Blob changes and typo
fixes.

Changes are included from:
- v8.1.0815
- v8.1.0846
- v8.1.1084
- v8.1.2326
- v8.2.1969
- d89682477c
- d09091d495
- 53f7fccc94
This commit is contained in:
Sean Dewar 2021-08-01 19:14:34 +01:00
parent 6eb41e5c8d
commit 10283915d6
No known key found for this signature in database
GPG Key ID: 08CC2C83AD41B581

View File

@ -604,8 +604,11 @@ Functions that can be used with a Dictionary: >
1.5 Blobs ~ 1.5 Blobs ~
*blob* *Blob* *Blobs* *E978* *blob* *Blob* *Blobs* *E978*
A Blob mostly behaves like a |List| of numbers, where the numbers have an A Blob is a binary object. It can be used to read an image from a file and
8-bit value, from 0 to 255. send it over a channel, for example.
A Blob mostly behaves like a |List| of numbers, where each number has the
value of an 8-bit byte, from 0 to 255.
Blob creation ~ Blob creation ~
@ -663,6 +666,7 @@ Part of a blob ~
A part of the Blob can be obtained by specifying the first and last index, A part of the Blob can be obtained by specifying the first and last index,
separated by a colon in square brackets: > separated by a colon in square brackets: >
:let myblob = 0z00112233 :let myblob = 0z00112233
:let shortblob = myblob[1:2] " get 0z1122
:let shortblob = myblob[2:-1] " get 0z2233 :let shortblob = myblob[2:-1] " get 0z2233
Omitting the first index is similar to zero. Omitting the last index is Omitting the first index is similar to zero. Omitting the last index is
@ -779,8 +783,9 @@ Expression syntax summary, from least to most significant:
etc. As above, append ? for ignoring case, # for etc. As above, append ? for ignoring case, # for
matching case matching case
expr5 is expr5 same |List| instance expr5 is expr5 same |List|, |Dictionary| or |Blob| instance
expr5 isnot expr5 different |List| instance expr5 isnot expr5 different |List|, |Dictionary| or |Blob|
instance
|expr5| expr6 |expr5| expr6
expr6 + expr6 ... number addition, list or blob concatenation expr6 + expr6 ... number addition, list or blob concatenation
@ -951,12 +956,12 @@ Dictionary and arguments, use |get()| to get the function name: >
if get(Part1, 'name') == get(Part2, 'name') if get(Part1, 'name') == get(Part2, 'name')
" Part1 and Part2 refer to the same function " Part1 and Part2 refer to the same function
When using "is" or "isnot" with a |List| or a |Dictionary| this checks if the Using "is" or "isnot" with a |List|, |Dictionary| or |Blob| checks whether
expressions are referring to the same |List| or |Dictionary| instance. A copy the expressions are referring to the same |List|, |Dictionary| or |Blob|
of a |List| is different from the original |List|. When using "is" without instance. A copy of a |List| is different from the original |List|. When
a |List| or a |Dictionary| it is equivalent to using "equal", using "isnot" using "is" without a |List|, |Dictionary| or |Blob|, it is equivalent to
equivalent to using "not equal". Except that a different type means the using "equal", using "isnot" is equivalent to using "not equal". Except that
values are different: > a different type means the values are different: >
echo 4 == '4' echo 4 == '4'
1 1
echo 4 is '4' echo 4 is '4'
@ -2155,21 +2160,21 @@ v:swapcommand Normal mode command to be executed after a file has been
For ":edit +cmd file" the value is ":cmd\r". For ":edit +cmd file" the value is ":cmd\r".
*v:t_TYPE* *v:t_bool* *t_bool-variable* *v:t_TYPE* *v:t_bool* *t_bool-variable*
v:t_bool Value of Boolean type. Read-only. See: |type()| v:t_bool Value of |Boolean| type. Read-only. See: |type()|
*v:t_dict* *t_dict-variable* *v:t_dict* *t_dict-variable*
v:t_dict Value of Dictionary type. Read-only. See: |type()| v:t_dict Value of |Dictionary| type. Read-only. See: |type()|
*v:t_float* *t_float-variable* *v:t_float* *t_float-variable*
v:t_float Value of Float type. Read-only. See: |type()| v:t_float Value of |Float| type. Read-only. See: |type()|
*v:t_func* *t_func-variable* *v:t_func* *t_func-variable*
v:t_func Value of Funcref type. Read-only. See: |type()| v:t_func Value of |Funcref| type. Read-only. See: |type()|
*v:t_list* *t_list-variable* *v:t_list* *t_list-variable*
v:t_list Value of List type. Read-only. See: |type()| v:t_list Value of |List| type. Read-only. See: |type()|
*v:t_number* *t_number-variable* *v:t_number* *t_number-variable*
v:t_number Value of Number type. Read-only. See: |type()| v:t_number Value of |Number| type. Read-only. See: |type()|
*v:t_string* *t_string-variable* *v:t_string* *t_string-variable*
v:t_string Value of String type. Read-only. See: |type()| v:t_string Value of |String| type. Read-only. See: |type()|
*v:t_blob* *t_blob-variable* *v:t_blob* *t_blob-variable*
v:t_blob Value of Blob type. Read-only. See: |type()| v:t_blob Value of |Blob| type. Read-only. See: |type()|
*v:termresponse* *termresponse-variable* *v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the DA v:termresponse The escape sequence returned by the terminal for the DA
@ -2574,7 +2579,10 @@ remote_read({serverid} [, {timeout}])
remote_send({server}, {string} [, {idvar}]) remote_send({server}, {string} [, {idvar}])
String send key sequence String send key sequence
remote_startserver({name}) none become server {name} remote_startserver({name}) none become server {name}
remove({list}, {idx} [, {end}]) any remove items {idx}-{end} from {list} remove({list}, {idx} [, {end}]) any/List
remove items {idx}-{end} from {list}
remove({blob}, {idx} [, {end}]) Number/Blob
remove bytes {idx}-{end} from {blob}
remove({dict}, {key}) any remove entry {key} from {dict} remove({dict}, {key}) any remove entry {key} from {dict}
rename({from}, {to}) Number rename (move) file from {from} to {to} rename({from}, {to}) Number rename (move) file from {from} to {to}
repeat({expr}, {count}) String repeat {expr} {count} times repeat({expr}, {count}) String repeat {expr} {count} times
@ -4236,7 +4244,7 @@ filter({expr1}, {expr2}) *filter()*
|Dictionary| to remain unmodified make a copy first: > |Dictionary| to remain unmodified make a copy first: >
:let l = filter(copy(mylist), 'v:val =~ "KEEP"') :let l = filter(copy(mylist), 'v:val =~ "KEEP"')
< Returns {expr1}, the |List| , |Blob| or |Dictionary| that was < Returns {expr1}, the |List|, |Blob| or |Dictionary| that was
filtered. When an error is encountered while evaluating filtered. When an error is encountered while evaluating
{expr2} no further items in {expr1} are processed. When {expr2} no further items in {expr1} are processed. When
{expr2} is a Funcref errors inside a function are ignored, {expr2} is a Funcref errors inside a function are ignored,
@ -6314,9 +6322,11 @@ luaeval({expr}[, {expr}])
to Vim data structures. See |lua-eval| for more details. to Vim data structures. See |lua-eval| for more details.
map({expr1}, {expr2}) *map()* map({expr1}, {expr2}) *map()*
{expr1} must be a |List| or a |Dictionary|. {expr1} must be a |List|, |Blob| or |Dictionary|.
Replace each item in {expr1} with the result of evaluating Replace each item in {expr1} with the result of evaluating
{expr2}. {expr2} must be a |string| or |Funcref|. {expr2}. For a |Blob| each byte is replaced.
{expr2} must be a |string| or |Funcref|.
If {expr2} is a |string|, inside {expr2} |v:val| has the value If {expr2} is a |string|, inside {expr2} |v:val| has the value
of the current item. For a |Dictionary| |v:key| has the key of the current item. For a |Dictionary| |v:key| has the key
@ -6352,11 +6362,11 @@ map({expr1}, {expr2}) *map()*
|Dictionary| to remain unmodified make a copy first: > |Dictionary| to remain unmodified make a copy first: >
:let tlist = map(copy(mylist), ' v:val . "\t"') :let tlist = map(copy(mylist), ' v:val . "\t"')
< Returns {expr1}, the |List| or |Dictionary| that was filtered. < Returns {expr1}, the |List|, |Blob| or |Dictionary| that was
When an error is encountered while evaluating {expr2} no filtered. When an error is encountered while evaluating
further items in {expr1} are processed. When {expr2} is a {expr2} no further items in {expr1} are processed. When
Funcref errors inside a function are ignored, unless it was {expr2} is a Funcref errors inside a function are ignored,
defined with the "abort" flag. unless it was defined with the "abort" flag.
Can also be used as a |method|: > Can also be used as a |method|: >
mylist->map(expr2) mylist->map(expr2)