diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2023-02-28 21:13:41 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-28 21:13:41 +0800 |
| commit | faa5d5be4b998427b3378d16ea5ce6ef6f5ddfd0 (patch) | |
| tree | 063953675bfa056f198975d7b420c4db81bdadd6 /runtime | |
| parent | 011b4c5c6203573aaf43d63999bd0af5a03882a4 (diff) | |
| parent | ccac34af766bee70d4f2a3cd69b54977849f567d (diff) | |
| download | rneovim-faa5d5be4b998427b3378d16ea5ce6ef6f5ddfd0.tar.gz rneovim-faa5d5be4b998427b3378d16ea5ce6ef6f5ddfd0.tar.bz2 rneovim-faa5d5be4b998427b3378d16ea5ce6ef6f5ddfd0.zip | |
Merge pull request #22455 from zeertzjq/vim-8.2.3438
vim-patch:8.2.{3438,3446}: blob2list(), list2blob()
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/doc/builtin.txt | 28 | ||||
| -rw-r--r-- | runtime/doc/sign.txt | 1 | ||||
| -rw-r--r-- | runtime/doc/usr_41.txt | 6 |
3 files changed, 34 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 568b73ddfa..b194a104f7 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -55,6 +55,7 @@ assert_report({msg}) Number report a test failure assert_true({actual} [, {msg}]) Number assert {actual} is true atan({expr}) Float arc tangent of {expr} atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2} +blob2list({blob}) List convert {blob} into a list of numbers browse({save}, {title}, {initdir}, {default}) String put up a file requester browsedir({title}, {initdir}) String put up a directory requester @@ -296,7 +297,8 @@ libcallnr({lib}, {func}, {arg}) Number idem, but return a Number line({expr} [, {winid}]) Number line nr of cursor, last line or mark line2byte({lnum}) Number byte count of line {lnum} lispindent({lnum}) Number Lisp indent for line {lnum} -list2str({list} [, {utf8}]) String turn numbers in {list} into a String +list2blob({list}) Blob turn {list} of numbers into a Blob +list2str({list} [, {utf8}]) String turn {list} of numbers into a String localtime() Number current time log({expr}) Float natural logarithm (base e) of {expr} log10({expr}) Float logarithm of Float {expr} to base 10 @@ -777,6 +779,17 @@ atan2({expr1}, {expr2}) *atan2()* Can also be used as a |method|: > Compute()->atan2(1) +blob2list({blob}) *blob2list()* + Return a List containing the number value of each byte in Blob + {blob}. Examples: > + blob2list(0z0102.0304) returns [1, 2, 3, 4] + blob2list(0z) returns [] +< Returns an empty List on error. |list2blob()| does the + opposite. + + Can also be used as a |method|: > + GetBlob()->blob2list() +< *browse()* browse({save}, {title}, {initdir}, {default}) Put up a file requester. This only works when "has("browse")" @@ -4768,6 +4781,19 @@ lispindent({lnum}) *lispindent()* Can also be used as a |method|: > GetLnum()->lispindent() +list2blob({list}) *list2blob()* + Return a Blob concatenating all the number values in {list}. + Examples: > + list2blob([1, 2, 3, 4]) returns 0z01020304 + list2blob([]) returns 0z +< Returns an empty Blob on error. If one of the numbers is + negative or more than 255 error *E1239* is given. + + |blob2list()| does the opposite. + + Can also be used as a |method|: > + GetList()->list2blob() + list2str({list} [, {utf8}]) *list2str()* Convert each number in {list} to a character string can concatenate them all. Examples: > diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index 162bdaed7b..9f469767a2 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -525,6 +525,7 @@ sign_jump({id}, {group}, {buf}) {buf} and position the cursor at sign {id} in group {group}. This is similar to the |:sign-jump| command. + If {group} is an empty string, then the global group is used. For the use of {buf}, see |bufname()|. Returns the line number of the sign. Returns -1 if the diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 0f2cfdd2ac..ed16f837cf 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -721,6 +721,10 @@ Floating point computation: *float-functions* isinf() check for infinity isnan() check for not a number +Blob manipulation: *blob-functions* + blob2list() get a list of numbers from a blob + list2blob() get a blob from a list of numbers + Other computation: *bitwise-function* and() bitwise AND invert() bitwise invert @@ -1321,6 +1325,8 @@ is a List with arguments. Function references are most useful in combination with a Dictionary, as is explained in the next section. +More information about defining your own functions here: |user-functions|. + ============================================================================== *41.8* Lists and Dictionaries |