mirror of
https://github.com/neovim/neovim.git
synced 2025-12-13 18:12:50 +00:00
documentation: Add notes to eval.txt and vim_diff.txt
This commit is contained in:
@@ -6221,12 +6221,22 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
|
|||||||
{expr} type result ~
|
{expr} type result ~
|
||||||
String 'string'
|
String 'string'
|
||||||
Number 123
|
Number 123
|
||||||
Float 123.123456 or 1.123456e8
|
Float 123.123456 or 1.123456e8 or
|
||||||
Funcref function('name')
|
`str2float('inf')`
|
||||||
|
Funcref `function('name')`
|
||||||
List [item, item]
|
List [item, item]
|
||||||
Dictionary {key: value, key: value}
|
Dictionary {key: value, key: value}
|
||||||
Note that in String values the ' character is doubled.
|
Note that in String values the ' character is doubled.
|
||||||
Also see |strtrans()|.
|
Also see |strtrans()|.
|
||||||
|
Note 2: Output format is mostly compatible with YAML, except
|
||||||
|
for infinite and NaN floating-point values representations
|
||||||
|
which use |str2float()|. Strings are also dumped literally,
|
||||||
|
only single quote is escaped, which does not allow using YAML
|
||||||
|
for parsing back binary strings (including text when
|
||||||
|
'encoding' is not UTF-8). |eval()| should always work for
|
||||||
|
strings and floats though and this is the only official
|
||||||
|
method, use |msgpackdump()| or |json_encode()| if you need to
|
||||||
|
share data with other application.
|
||||||
|
|
||||||
*strlen()*
|
*strlen()*
|
||||||
strlen({expr}) The result is a Number, which is the length of the String
|
strlen({expr}) The result is a Number, which is the length of the String
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ are always available and may be used simultaneously in separate plugins. The
|
|||||||
Same thing applies to |string()| (though it uses construct like
|
Same thing applies to |string()| (though it uses construct like
|
||||||
"{E724@level}"), but this is not reliable because |string()| continues to
|
"{E724@level}"), but this is not reliable because |string()| continues to
|
||||||
error out.
|
error out.
|
||||||
|
4. Stringifyed infinite and NaN values now use |str2float()| and can be evaled
|
||||||
|
back.
|
||||||
|
|
||||||
Viminfo text files were replaced with binary (messagepack) ShaDa files.
|
Viminfo text files were replaced with binary (messagepack) ShaDa files.
|
||||||
Additional differences:
|
Additional differences:
|
||||||
|
|||||||
Reference in New Issue
Block a user