|
1 | | -*eval.txt* For Vim version 7.4. Last change: 2016 Jan 24 |
| 1 | +*eval.txt* For Vim version 7.4. Last change: 2016 Jan 28 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -2842,6 +2842,7 @@ empty({expr}) *empty()* |
2842 | 2842 | Return the Number 1 if {expr} is empty, zero otherwise. |
2843 | 2843 | A |List| or |Dictionary| is empty when it does not have any |
2844 | 2844 | items. A Number is empty when its value is zero. |
| 2845 | + |v:false|, |v:none| and |v:null| are empty, |v:true| is not. |
2845 | 2846 | For a long |List| this is much faster than comparing the |
2846 | 2847 | length with zero. |
2847 | 2848 |
|
@@ -4252,16 +4253,21 @@ jsondecode({string}) *jsondecode()* |
4252 | 4253 | JSON and Vim values. |
4253 | 4254 | The decoding is permissive: |
4254 | 4255 | - A trailing comma in an array and object is ignored. |
4255 | | - - An empty item in an array results in v:none. |
4256 | | - - When an object name is not a string it is converted to a |
4257 | | - string. E.g. the number 123 is used as the string "123". |
| 4256 | + - An empty item in an array, two commas with nothing or white |
| 4257 | + space in between, results in v:none. |
| 4258 | + - When an object member name is not a string it is converted |
| 4259 | + to a string. E.g. the number 123 is used as the string |
| 4260 | + "123". |
4258 | 4261 | - More floating point numbers are recognized, e.g. "1." for |
4259 | 4262 | "1.0". |
| 4263 | + The result must be a valid Vim type: |
| 4264 | + - An empty object member name is not allowed. |
| 4265 | + - Duplicate object member names are not allowed. |
4260 | 4266 |
|
4261 | 4267 | jsonencode({expr}) *jsonencode()* |
4262 | 4268 | Encode {expr} as JSON and return this as a string. |
4263 | 4269 | The encoding is specified in: |
4264 | | - http://www.ietf.org/rfc/rfc4627.txt |
| 4270 | + https://tools.ietf.org/html/rfc7159.html |
4265 | 4271 | Vim values are converted as follows: |
4266 | 4272 | Number decimal number |
4267 | 4273 | Float floating point number |
@@ -5889,18 +5895,8 @@ shellescape({string} [, {special}]) *shellescape()* |
5889 | 5895 | shiftwidth() *shiftwidth()* |
5890 | 5896 | Returns the effective value of 'shiftwidth'. This is the |
5891 | 5897 | 'shiftwidth' value unless it is zero, in which case it is the |
5892 | | - 'tabstop' value. To be backwards compatible in indent |
5893 | | - plugins, use this: > |
5894 | | - if exists('*shiftwidth') |
5895 | | - func s:sw() |
5896 | | - return shiftwidth() |
5897 | | - endfunc |
5898 | | - else |
5899 | | - func s:sw() |
5900 | | - return &sw |
5901 | | - endfunc |
5902 | | - endif |
5903 | | -< And then use s:sw() instead of &sw. |
| 5898 | + 'tabstop' value. This function was introduced with patch |
| 5899 | + 7.3.694 in 2012, everybody should have it by now. |
5904 | 5900 |
|
5905 | 5901 |
|
5906 | 5902 | simplify({filename}) *simplify()* |
|
0 commit comments