Skip to content

Commit 705ada1

Browse files
committed
Update a few runtime files.
1 parent f48aa16 commit 705ada1

4 files changed

Lines changed: 60 additions & 16 deletions

File tree

runtime/doc/eval.txt

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 23
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 24
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1412,6 +1412,9 @@ v:exception The value of the exception most recently caught and not
14121412
*v:false* *false-variable*
14131413
v:false A Number with value zero. Used to put "false" in JSON. See
14141414
|jsonencode()|.
1415+
When used as a string this evaluates to "false". >
1416+
echo v:false
1417+
< false ~
14151418

14161419
*v:fcs_reason* *fcs_reason-variable*
14171420
v:fcs_reason The reason why the |FileChangedShell| event was triggered.
@@ -1489,7 +1492,7 @@ v:foldstart Used for 'foldtext': first line of closed fold.
14891492
v:hlsearch Variable that indicates whether search highlighting is on.
14901493
Setting it makes sense only if 'hlsearch' is enabled which
14911494
requires |+extra_search|. Setting this variable to zero acts
1492-
the like |:nohlsearch| command, setting it to one acts like >
1495+
like the |:nohlsearch| command, setting it to one acts like >
14931496
let &hlsearch = &hlsearch
14941497
< Note that the value is restored when returning from a
14951498
function. |function-search-undo|.
@@ -1549,10 +1552,18 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|.
15491552
*v:none* *none-variable*
15501553
v:none An empty String. Used to put an empty item in JSON. See
15511554
|jsonencode()|.
1555+
When used as a number this evaluates to zero.
1556+
When used as a string this evaluates to "none". >
1557+
echo v:none
1558+
< none ~
15521559

15531560
*v:null* *null-variable*
15541561
v:null An empty String. Used to put "null" in JSON. See
15551562
|jsonencode()|.
1563+
When used as a number this evaluates to zero.
1564+
When used as a string this evaluates to "null". >
1565+
echo v:null
1566+
< null ~
15561567

15571568
*v:oldfiles* *oldfiles-variable*
15581569
v:oldfiles List of file names that is loaded from the |viminfo| file on
@@ -1722,7 +1733,9 @@ v:throwpoint The point where the exception most recently caught and not
17221733
*v:true* *true-variable*
17231734
v:true A Number with value one. Used to put "true" in JSON. See
17241735
|jsonencode()|.
1725-
1736+
When used as a string this evaluates to "true". >
1737+
echo v:true
1738+
< true ~
17261739
*v:val* *val-variable*
17271740
v:val Value of the current item of a |List| or |Dictionary|. Only
17281741
valid while evaluating the expression used with |map()| and
@@ -4234,17 +4247,26 @@ join({list} [, {sep}]) *join()*
42344247
The opposite function is |split()|.
42354248

42364249
jsondecode({string}) *jsondecode()*
4237-
TODO
4250+
This parses a JSON formatted string and returns the equivalent
4251+
in Vim values. See |jsonencode()| for the relation between
4252+
JSON and Vim values.
4253+
The decoding is permissive:
4254+
- 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".
4258+
- More floating point numbers are recognized, e.g. "1." for
4259+
"1.0".
42384260

42394261
jsonencode({expr}) *jsonencode()*
4240-
Encodode {expr} as JSON and return this as a string.
4262+
Encode {expr} as JSON and return this as a string.
42414263
The encoding is specified in:
42424264
http://www.ietf.org/rfc/rfc4627.txt
42434265
Vim values are converted as follows:
42444266
Number decimal number
42454267
Float floating point number
42464268
String in double quotes (possibly null)
4247-
Funcref nothing
4269+
Funcref not possible, error
42484270
List as an array (possibly null); when
42494271
used recursively: []
42504272
Dict as an object (possibly null); when
@@ -4253,6 +4275,13 @@ jsonencode({expr}) *jsonencode()*
42534275
v:true "true"
42544276
v:none nothing
42554277
v:null "null"
4278+
Note that using v:none is permitted, although the JSON
4279+
standard does not allow empty items. This can be useful for
4280+
omitting items in an array:
4281+
[0,,,,,5] ~
4282+
This is much more efficient than:
4283+
[0,null,null,null,null,5] ~
4284+
But a strict JSON parser will not accept it.
42564285

42574286
keys({dict}) *keys()*
42584287
Return a |List| with all the keys of {dict}. The |List| is in
@@ -6615,13 +6644,17 @@ type({expr}) The result is a Number, depending on the type of {expr}:
66156644
List: 3
66166645
Dictionary: 4
66176646
Float: 5
6647+
Boolean: 6 (v:false and v:true)
6648+
None 7 (v:null and v:none)
66186649
To avoid the magic numbers it should be used this way: >
66196650
:if type(myvar) == type(0)
66206651
:if type(myvar) == type("")
66216652
:if type(myvar) == type(function("tr"))
66226653
:if type(myvar) == type([])
66236654
:if type(myvar) == type({})
66246655
:if type(myvar) == type(0.0)
6656+
:if type(myvar) == type(v:false)
6657+
:if type(myvar) == type(v:none
66256658
66266659
undofile({name}) *undofile()*
66276660
Return the name of the undo file that would be used for a file

runtime/doc/if_mzsch.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*if_mzsch.txt* For Vim version 7.4. Last change: 2016 Jan 16
1+
*if_mzsch.txt* For Vim version 7.4. Last change: 2016 Jan 24
22

33

44
VIM REFERENCE MANUAL by Sergey Khorev
@@ -265,7 +265,7 @@ directly from Scheme. For instance: >
265265
<
266266

267267
==============================================================================
268-
7. Dynamic loading *mzscheme-dynamic* *E815*
268+
7. Dynamic loading *mzscheme-dynamic* *E815*
269269

270270
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
271271
output then includes |+mzscheme/dyn|.
@@ -294,7 +294,7 @@ to set the environment variable as the following: >
294294
PLTCONFIGDIR=C:\Racket63\etc
295295
<
296296
==============================================================================
297-
8. MzScheme setup *mzscheme-setup*
297+
8. MzScheme setup *mzscheme-setup* *E895*
298298

299299
Vim requires "racket/base" module for if_mzsch core (fallback to "scheme/base"
300300
if it doesn't exist), "r5rs" module for test and "raco ctool" command for

runtime/doc/tags

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4422,6 +4422,7 @@ E891 eval.txt /*E891*
44224422
E892 eval.txt /*E892*
44234423
E893 eval.txt /*E893*
44244424
E894 eval.txt /*E894*
4425+
E895 if_mzsch.txt /*E895*
44254426
E90 message.txt /*E90*
44264427
E91 options.txt /*E91*
44274428
E92 message.txt /*E92*
@@ -5730,6 +5731,7 @@ extend() eval.txt /*extend()*
57305731
extension-removal cmdline.txt /*extension-removal*
57315732
extensions-improvements todo.txt /*extensions-improvements*
57325733
f motion.txt /*f*
5734+
false-variable eval.txt /*false-variable*
57335735
faq intro.txt /*faq*
57345736
farsi farsi.txt /*farsi*
57355737
farsi-fonts farsi.txt /*farsi-fonts*
@@ -6786,6 +6788,8 @@ javascript-cinoptions indent.txt /*javascript-cinoptions*
67866788
javascript-indenting indent.txt /*javascript-indenting*
67876789
join() eval.txt /*join()*
67886790
jsbterm-mouse options.txt /*jsbterm-mouse*
6791+
jsondecode() eval.txt /*jsondecode()*
6792+
jsonencode() eval.txt /*jsonencode()*
67896793
jtags tagsrch.txt /*jtags*
67906794
jump-motions motion.txt /*jump-motions*
67916795
jumplist motion.txt /*jumplist*
@@ -7435,13 +7439,15 @@ no-eval-feature eval.txt /*no-eval-feature*
74357439
no_buffers_menu gui.txt /*no_buffers_menu*
74367440
non-greedy pattern.txt /*non-greedy*
74377441
non-zero-arg eval.txt /*non-zero-arg*
7442+
none-variable eval.txt /*none-variable*
74387443
normal-index index.txt /*normal-index*
74397444
not-compatible usr_01.txt /*not-compatible*
74407445
not-edited editing.txt /*not-edited*
74417446
notation intro.txt /*notation*
74427447
notepad gui_w32.txt /*notepad*
74437448
nr2char() eval.txt /*nr2char()*
74447449
nroff.vim syntax.txt /*nroff.vim*
7450+
null-variable eval.txt /*null-variable*
74457451
number_relativenumber options.txt /*number_relativenumber*
74467452
numbered-function eval.txt /*numbered-function*
74477453
o insert.txt /*o*
@@ -8509,6 +8515,7 @@ toolbar-icon gui.txt /*toolbar-icon*
85098515
toupper() eval.txt /*toupper()*
85108516
tr() eval.txt /*tr()*
85118517
trojan-horse starting.txt /*trojan-horse*
8518+
true-variable eval.txt /*true-variable*
85128519
trunc() eval.txt /*trunc()*
85138520
try-conditionals eval.txt /*try-conditionals*
85148521
try-echoerr eval.txt /*try-echoerr*
@@ -8618,6 +8625,7 @@ v:dying eval.txt /*v:dying*
86188625
v:errmsg eval.txt /*v:errmsg*
86198626
v:errors eval.txt /*v:errors*
86208627
v:exception eval.txt /*v:exception*
8628+
v:false eval.txt /*v:false*
86218629
v:fcs_choice eval.txt /*v:fcs_choice*
86228630
v:fcs_reason eval.txt /*v:fcs_reason*
86238631
v:fname_diff eval.txt /*v:fname_diff*
@@ -8637,6 +8645,8 @@ v:lnum eval.txt /*v:lnum*
86378645
v:mouse_col eval.txt /*v:mouse_col*
86388646
v:mouse_lnum eval.txt /*v:mouse_lnum*
86398647
v:mouse_win eval.txt /*v:mouse_win*
8648+
v:none eval.txt /*v:none*
8649+
v:null eval.txt /*v:null*
86408650
v:oldfiles eval.txt /*v:oldfiles*
86418651
v:operator eval.txt /*v:operator*
86428652
v:option_new eval.txt /*v:option_new*
@@ -8658,6 +8668,7 @@ v:swapname eval.txt /*v:swapname*
86588668
v:termresponse eval.txt /*v:termresponse*
86598669
v:this_session eval.txt /*v:this_session*
86608670
v:throwpoint eval.txt /*v:throwpoint*
8671+
v:true eval.txt /*v:true*
86618672
v:val eval.txt /*v:val*
86628673
v:var eval.txt /*v:var*
86638674
v:version eval.txt /*v:version*

runtime/indent/vim.vim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim indent file
22
" Language: Vim script
33
" Maintainer: Bram Moolenaar <[email protected]>
4-
" Last Change: 2014 Dec 12
4+
" Last Change: 2016 Jan 24
55

66
" Only load this indent file when no other was loaded.
77
if exists("b:did_indent")
@@ -58,19 +58,19 @@ function GetVimIndentIntern()
5858
if exists("g:vim_indent_cont")
5959
let ind = ind + g:vim_indent_cont
6060
else
61-
let ind = ind + &sw * 3
61+
let ind = ind + shiftwidth() * 3
6262
endif
6363
elseif prev_text =~ '^\s*aug\%[roup]' && prev_text !~ '^\s*aug\%[roup]\s*!\=\s\+END'
64-
let ind = ind + &sw
64+
let ind = ind + shiftwidth()
6565
else
6666
" A line starting with :au does not increment/decrement indent.
6767
if prev_text !~ '^\s*au\%[tocmd]'
6868
let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
6969
if i >= 0
70-
let ind += &sw
70+
let ind += shiftwidth()
7171
if strpart(prev_text, i, 1) == '|' && has('syntax_items')
7272
\ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
73-
let ind -= &sw
73+
let ind -= shiftwidth()
7474
endif
7575
endif
7676
endif
@@ -82,15 +82,15 @@ function GetVimIndentIntern()
8282
let i = match(prev_text, '[^\\]|\s*\(ene\@!\)')
8383
if i > 0 && prev_text !~ '^\s*au\%[tocmd]'
8484
if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$'
85-
let ind = ind - &sw
85+
let ind = ind - shiftwidth()
8686
endif
8787
endif
8888

8989

9090
" Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
9191
" :endfun, :else and :augroup END.
9292
if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+[eE][nN][dD]\)'
93-
let ind = ind - &sw
93+
let ind = ind - shiftwidth()
9494
endif
9595

9696
return ind

0 commit comments

Comments
 (0)