0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 7.4.1188

Problem:    Using older JSON standard.
Solution:   Update the link.  Adjust the text a bit.
This commit is contained in:
Bram Moolenaar 2016-01-28 14:12:00 +01:00
parent 85be35f33e
commit 009d84a34f
3 changed files with 16 additions and 18 deletions

View File

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

View File

@ -10,7 +10,7 @@
/* /*
* json.c: Encoding and decoding JSON. * json.c: Encoding and decoding JSON.
* *
* Follows this standard: http://www.ietf.org/rfc/rfc4627.txt * Follows this standard: https://tools.ietf.org/html/rfc7159.html
*/ */
#include "vim.h" #include "vim.h"

View File

@ -746,6 +746,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 */
/**/
1188,
/**/ /**/
1187, 1187,
/**/ /**/