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

Update a few runtime files.

This commit is contained in:
Bram Moolenaar 2016-01-24 17:56:50 +01:00
parent f48aa160fd
commit 705ada1aff
4 changed files with 60 additions and 16 deletions

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 23 *eval.txt* For Vim version 7.4. Last change: 2016 Jan 24
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1412,6 +1412,9 @@ v:exception The value of the exception most recently caught and not
*v:false* *false-variable* *v:false* *false-variable*
v:false A Number with value zero. Used to put "false" in JSON. See v:false A Number with value zero. Used to put "false" in JSON. See
|jsonencode()|. |jsonencode()|.
When used as a string this evaluates to "false". >
echo v:false
< false ~
*v:fcs_reason* *fcs_reason-variable* *v:fcs_reason* *fcs_reason-variable*
v:fcs_reason The reason why the |FileChangedShell| event was triggered. 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.
v:hlsearch Variable that indicates whether search highlighting is on. v:hlsearch Variable that indicates whether search highlighting is on.
Setting it makes sense only if 'hlsearch' is enabled which Setting it makes sense only if 'hlsearch' is enabled which
requires |+extra_search|. Setting this variable to zero acts requires |+extra_search|. Setting this variable to zero acts
the like |:nohlsearch| command, setting it to one acts like > like the |:nohlsearch| command, setting it to one acts like >
let &hlsearch = &hlsearch let &hlsearch = &hlsearch
< Note that the value is restored when returning from a < Note that the value is restored when returning from a
function. |function-search-undo|. function. |function-search-undo|.
@ -1549,10 +1552,18 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|.
*v:none* *none-variable* *v:none* *none-variable*
v:none An empty String. Used to put an empty item in JSON. See v:none An empty String. Used to put an empty item in JSON. See
|jsonencode()|. |jsonencode()|.
When used as a number this evaluates to zero.
When used as a string this evaluates to "none". >
echo v:none
< none ~
*v:null* *null-variable* *v:null* *null-variable*
v:null An empty String. Used to put "null" in JSON. See v:null An empty String. Used to put "null" in JSON. See
|jsonencode()|. |jsonencode()|.
When used as a number this evaluates to zero.
When used as a string this evaluates to "null". >
echo v:null
< null ~
*v:oldfiles* *oldfiles-variable* *v:oldfiles* *oldfiles-variable*
v:oldfiles List of file names that is loaded from the |viminfo| file on 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
*v:true* *true-variable* *v:true* *true-variable*
v:true A Number with value one. Used to put "true" in JSON. See v:true A Number with value one. Used to put "true" in JSON. See
|jsonencode()|. |jsonencode()|.
When used as a string this evaluates to "true". >
echo v:true
< true ~
*v:val* *val-variable* *v:val* *val-variable*
v:val Value of the current item of a |List| or |Dictionary|. Only v:val Value of the current item of a |List| or |Dictionary|. Only
valid while evaluating the expression used with |map()| and valid while evaluating the expression used with |map()| and
@ -4234,17 +4247,26 @@ join({list} [, {sep}]) *join()*
The opposite function is |split()|. The opposite function is |split()|.
jsondecode({string}) *jsondecode()* jsondecode({string}) *jsondecode()*
TODO This parses a JSON formatted string and returns the equivalent
in Vim values. See |jsonencode()| for the relation between
JSON and Vim values.
The decoding is permissive:
- A trailing comma in an array and object is ignored.
- An empty item in an array results in v:none.
- When an object 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
"1.0".
jsonencode({expr}) *jsonencode()* jsonencode({expr}) *jsonencode()*
Encodode {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 http://www.ietf.org/rfc/rfc4627.txt
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
String in double quotes (possibly null) String in double quotes (possibly null)
Funcref nothing Funcref not possible, error
List as an array (possibly null); when List as an array (possibly null); when
used recursively: [] used recursively: []
Dict as an object (possibly null); when Dict as an object (possibly null); when
@ -4253,6 +4275,13 @@ jsonencode({expr}) *jsonencode()*
v:true "true" v:true "true"
v:none nothing v:none nothing
v:null "null" v:null "null"
Note that using v:none is permitted, although the JSON
standard does not allow empty items. This can be useful for
omitting items in an array:
[0,,,,,5] ~
This is much more efficient than:
[0,null,null,null,null,5] ~
But a strict JSON parser will not accept it.
keys({dict}) *keys()* keys({dict}) *keys()*
Return a |List| with all the keys of {dict}. The |List| is in Return a |List| with all the keys of {dict}. The |List| is in
@ -6615,6 +6644,8 @@ type({expr}) The result is a Number, depending on the type of {expr}:
List: 3 List: 3
Dictionary: 4 Dictionary: 4
Float: 5 Float: 5
Boolean: 6 (v:false and v:true)
None 7 (v:null and v:none)
To avoid the magic numbers it should be used this way: > To avoid the magic numbers it should be used this way: >
:if type(myvar) == type(0) :if type(myvar) == type(0)
:if type(myvar) == type("") :if type(myvar) == type("")
@ -6622,6 +6653,8 @@ type({expr}) The result is a Number, depending on the type of {expr}:
:if type(myvar) == type([]) :if type(myvar) == type([])
:if type(myvar) == type({}) :if type(myvar) == type({})
:if type(myvar) == type(0.0) :if type(myvar) == type(0.0)
:if type(myvar) == type(v:false)
:if type(myvar) == type(v:none
undofile({name}) *undofile()* undofile({name}) *undofile()*
Return the name of the undo file that would be used for a file Return the name of the undo file that would be used for a file

View File

@ -1,4 +1,4 @@
*if_mzsch.txt* For Vim version 7.4. Last change: 2016 Jan 16 *if_mzsch.txt* For Vim version 7.4. Last change: 2016 Jan 24
VIM REFERENCE MANUAL by Sergey Khorev VIM REFERENCE MANUAL by Sergey Khorev
@ -265,7 +265,7 @@ directly from Scheme. For instance: >
< <
============================================================================== ==============================================================================
7. Dynamic loading *mzscheme-dynamic* *E815* 7. Dynamic loading *mzscheme-dynamic* *E815*
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version| On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
output then includes |+mzscheme/dyn|. output then includes |+mzscheme/dyn|.
@ -294,7 +294,7 @@ to set the environment variable as the following: >
PLTCONFIGDIR=C:\Racket63\etc PLTCONFIGDIR=C:\Racket63\etc
< <
============================================================================== ==============================================================================
8. MzScheme setup *mzscheme-setup* 8. MzScheme setup *mzscheme-setup* *E895*
Vim requires "racket/base" module for if_mzsch core (fallback to "scheme/base" Vim requires "racket/base" module for if_mzsch core (fallback to "scheme/base"
if it doesn't exist), "r5rs" module for test and "raco ctool" command for if it doesn't exist), "r5rs" module for test and "raco ctool" command for

View File

@ -4422,6 +4422,7 @@ E891 eval.txt /*E891*
E892 eval.txt /*E892* E892 eval.txt /*E892*
E893 eval.txt /*E893* E893 eval.txt /*E893*
E894 eval.txt /*E894* E894 eval.txt /*E894*
E895 if_mzsch.txt /*E895*
E90 message.txt /*E90* E90 message.txt /*E90*
E91 options.txt /*E91* E91 options.txt /*E91*
E92 message.txt /*E92* E92 message.txt /*E92*
@ -5730,6 +5731,7 @@ extend() eval.txt /*extend()*
extension-removal cmdline.txt /*extension-removal* extension-removal cmdline.txt /*extension-removal*
extensions-improvements todo.txt /*extensions-improvements* extensions-improvements todo.txt /*extensions-improvements*
f motion.txt /*f* f motion.txt /*f*
false-variable eval.txt /*false-variable*
faq intro.txt /*faq* faq intro.txt /*faq*
farsi farsi.txt /*farsi* farsi farsi.txt /*farsi*
farsi-fonts farsi.txt /*farsi-fonts* farsi-fonts farsi.txt /*farsi-fonts*
@ -6786,6 +6788,8 @@ javascript-cinoptions indent.txt /*javascript-cinoptions*
javascript-indenting indent.txt /*javascript-indenting* javascript-indenting indent.txt /*javascript-indenting*
join() eval.txt /*join()* join() eval.txt /*join()*
jsbterm-mouse options.txt /*jsbterm-mouse* jsbterm-mouse options.txt /*jsbterm-mouse*
jsondecode() eval.txt /*jsondecode()*
jsonencode() eval.txt /*jsonencode()*
jtags tagsrch.txt /*jtags* jtags tagsrch.txt /*jtags*
jump-motions motion.txt /*jump-motions* jump-motions motion.txt /*jump-motions*
jumplist motion.txt /*jumplist* jumplist motion.txt /*jumplist*
@ -7435,6 +7439,7 @@ no-eval-feature eval.txt /*no-eval-feature*
no_buffers_menu gui.txt /*no_buffers_menu* no_buffers_menu gui.txt /*no_buffers_menu*
non-greedy pattern.txt /*non-greedy* non-greedy pattern.txt /*non-greedy*
non-zero-arg eval.txt /*non-zero-arg* non-zero-arg eval.txt /*non-zero-arg*
none-variable eval.txt /*none-variable*
normal-index index.txt /*normal-index* normal-index index.txt /*normal-index*
not-compatible usr_01.txt /*not-compatible* not-compatible usr_01.txt /*not-compatible*
not-edited editing.txt /*not-edited* not-edited editing.txt /*not-edited*
@ -7442,6 +7447,7 @@ notation intro.txt /*notation*
notepad gui_w32.txt /*notepad* notepad gui_w32.txt /*notepad*
nr2char() eval.txt /*nr2char()* nr2char() eval.txt /*nr2char()*
nroff.vim syntax.txt /*nroff.vim* nroff.vim syntax.txt /*nroff.vim*
null-variable eval.txt /*null-variable*
number_relativenumber options.txt /*number_relativenumber* number_relativenumber options.txt /*number_relativenumber*
numbered-function eval.txt /*numbered-function* numbered-function eval.txt /*numbered-function*
o insert.txt /*o* o insert.txt /*o*
@ -8509,6 +8515,7 @@ toolbar-icon gui.txt /*toolbar-icon*
toupper() eval.txt /*toupper()* toupper() eval.txt /*toupper()*
tr() eval.txt /*tr()* tr() eval.txt /*tr()*
trojan-horse starting.txt /*trojan-horse* trojan-horse starting.txt /*trojan-horse*
true-variable eval.txt /*true-variable*
trunc() eval.txt /*trunc()* trunc() eval.txt /*trunc()*
try-conditionals eval.txt /*try-conditionals* try-conditionals eval.txt /*try-conditionals*
try-echoerr eval.txt /*try-echoerr* try-echoerr eval.txt /*try-echoerr*
@ -8618,6 +8625,7 @@ v:dying eval.txt /*v:dying*
v:errmsg eval.txt /*v:errmsg* v:errmsg eval.txt /*v:errmsg*
v:errors eval.txt /*v:errors* v:errors eval.txt /*v:errors*
v:exception eval.txt /*v:exception* v:exception eval.txt /*v:exception*
v:false eval.txt /*v:false*
v:fcs_choice eval.txt /*v:fcs_choice* v:fcs_choice eval.txt /*v:fcs_choice*
v:fcs_reason eval.txt /*v:fcs_reason* v:fcs_reason eval.txt /*v:fcs_reason*
v:fname_diff eval.txt /*v:fname_diff* v:fname_diff eval.txt /*v:fname_diff*
@ -8637,6 +8645,8 @@ v:lnum eval.txt /*v:lnum*
v:mouse_col eval.txt /*v:mouse_col* v:mouse_col eval.txt /*v:mouse_col*
v:mouse_lnum eval.txt /*v:mouse_lnum* v:mouse_lnum eval.txt /*v:mouse_lnum*
v:mouse_win eval.txt /*v:mouse_win* v:mouse_win eval.txt /*v:mouse_win*
v:none eval.txt /*v:none*
v:null eval.txt /*v:null*
v:oldfiles eval.txt /*v:oldfiles* v:oldfiles eval.txt /*v:oldfiles*
v:operator eval.txt /*v:operator* v:operator eval.txt /*v:operator*
v:option_new eval.txt /*v:option_new* v:option_new eval.txt /*v:option_new*
@ -8658,6 +8668,7 @@ v:swapname eval.txt /*v:swapname*
v:termresponse eval.txt /*v:termresponse* v:termresponse eval.txt /*v:termresponse*
v:this_session eval.txt /*v:this_session* v:this_session eval.txt /*v:this_session*
v:throwpoint eval.txt /*v:throwpoint* v:throwpoint eval.txt /*v:throwpoint*
v:true eval.txt /*v:true*
v:val eval.txt /*v:val* v:val eval.txt /*v:val*
v:var eval.txt /*v:var* v:var eval.txt /*v:var*
v:version eval.txt /*v:version* v:version eval.txt /*v:version*

View File

@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: Vim script " Language: Vim script
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Dec 12 " Last Change: 2016 Jan 24
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
@ -58,19 +58,19 @@ function GetVimIndentIntern()
if exists("g:vim_indent_cont") if exists("g:vim_indent_cont")
let ind = ind + g:vim_indent_cont let ind = ind + g:vim_indent_cont
else else
let ind = ind + &sw * 3 let ind = ind + shiftwidth() * 3
endif endif
elseif prev_text =~ '^\s*aug\%[roup]' && prev_text !~ '^\s*aug\%[roup]\s*!\=\s\+END' elseif prev_text =~ '^\s*aug\%[roup]' && prev_text !~ '^\s*aug\%[roup]\s*!\=\s\+END'
let ind = ind + &sw let ind = ind + shiftwidth()
else else
" A line starting with :au does not increment/decrement indent. " A line starting with :au does not increment/decrement indent.
if prev_text !~ '^\s*au\%[tocmd]' if prev_text !~ '^\s*au\%[tocmd]'
let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>') let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
if i >= 0 if i >= 0
let ind += &sw let ind += shiftwidth()
if strpart(prev_text, i, 1) == '|' && has('syntax_items') if strpart(prev_text, i, 1) == '|' && has('syntax_items')
\ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$' \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
let ind -= &sw let ind -= shiftwidth()
endif endif
endif endif
endif endif
@ -82,7 +82,7 @@ function GetVimIndentIntern()
let i = match(prev_text, '[^\\]|\s*\(ene\@!\)') let i = match(prev_text, '[^\\]|\s*\(ene\@!\)')
if i > 0 && prev_text !~ '^\s*au\%[tocmd]' if i > 0 && prev_text !~ '^\s*au\%[tocmd]'
if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$' if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
endif endif
@ -90,7 +90,7 @@ function GetVimIndentIntern()
" Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry, " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
" :endfun, :else and :augroup END. " :endfun, :else and :augroup END.
if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+[eE][nN][dD]\)' if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+[eE][nN][dD]\)'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
return ind return ind