Skip to content

Commit 463f72a

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 4064af0 + da861d6 commit 463f72a

69 files changed

Lines changed: 5363 additions & 3549 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Filelist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ SRC_ALL = \
1818
src/charset.c \
1919
src/crypt.c \
2020
src/crypt_zip.c \
21+
src/dict.c \
2122
src/diff.c \
2223
src/digraph.c \
2324
src/edit.c \
@@ -43,6 +44,7 @@ SRC_ALL = \
4344
src/hashtab.c \
4445
src/json.c \
4546
src/json_test.c \
47+
src/list.c \
4648
src/keymap.h \
4749
src/macros.h \
4850
src/main.c \
@@ -53,6 +55,7 @@ SRC_ALL = \
5355
src/memline.c \
5456
src/menu.c \
5557
src/message.c \
58+
src/message_test.c \
5659
src/misc1.c \
5760
src/misc2.c \
5861
src/move.c \
@@ -95,6 +98,8 @@ SRC_ALL = \
9598
src/testdir/*.py \
9699
src/testdir/sautest/autoload/*.vim \
97100
src/testdir/runtest.vim \
101+
src/testdir/shared.vim \
102+
src/testdir/setup.vim \
98103
src/testdir/test[0-9]*.ok \
99104
src/testdir/test[0-9]*a.ok \
100105
src/testdir/test_[a-z]*.ok \
@@ -123,6 +128,7 @@ SRC_ALL = \
123128
src/proto/charset.pro \
124129
src/proto/crypt.pro \
125130
src/proto/crypt_zip.pro \
131+
src/proto/dict.pro \
126132
src/proto/diff.pro \
127133
src/proto/digraph.pro \
128134
src/proto/edit.pro \
@@ -141,6 +147,7 @@ SRC_ALL = \
141147
src/proto/hardcopy.pro \
142148
src/proto/hashtab.pro \
143149
src/proto/json.pro \
150+
src/proto/list.pro \
144151
src/proto/main.pro \
145152
src/proto/mark.pro \
146153
src/proto/mbyte.pro \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ first:
3232

3333
# Some make programs use the last target for the $@ default; put the other
3434
# targets separately to always let $@ expand to "first" by default.
35-
all install uninstall tools config configure reconfig proto depend lint tags types test testclean clean distclean:
35+
all install uninstall tools config configure reconfig proto depend lint tags types test scripttests unittests testclean clean distclean:
3636
@if test ! -f src/auto/config.mk; then \
3737
cp src/config.mk.dist src/auto/config.mk; \
3838
fi

runtime/doc/channel.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
*channel.txt* For Vim version 7.4. Last change: 2016 Jul 07
1+
*channel.txt* For Vim version 7.4. Last change: 2016 Jul 15
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
55

66

77
Inter-process communication *channel*
88

9-
DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
10-
119
Vim uses channels to communicate with other processes.
12-
A channel uses a socket or pipes *socket-interface*
10+
A channel uses a socket or pipes. *socket-interface*
1311
Jobs can be used to start processes and communicate with them.
14-
15-
Vim current supports up to 10 simultaneous channels.
1612
The Netbeans interface also uses a channel. |netbeans|
1713

1814
1. Overview |job-channel-overview|
@@ -569,11 +565,13 @@ See |job_setoptions()| and |ch_setoptions()|.
569565
"out_cb": handler Callback for when there is something to read on
570566
stdout. Only for when the channel uses pipes. When
571567
"out_cb" wasn't set the channel callback is used.
568+
The two arguments are the channel and the message.
572569

573570
*job-err_cb* *err_cb*
574571
"err_cb": handler Callback for when there is something to read on
575572
stderr. Only for when the channel uses pipes. When
576573
"err_cb" wasn't set the channel callback is used.
574+
The two arguments are the channel and the message.
577575
*job-close_cb*
578576
"close_cb": handler Callback for when the channel is closed. Same as
579577
"close_cb" on |ch_open()|, see |close_cb|.

runtime/doc/eval.txt

Lines changed: 72 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2016 Jul 09
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Jul 16
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -140,9 +140,10 @@ You will not get an error if you try to change the type of a variable.
140140

141141
1.2 Function references ~
142142
*Funcref* *E695* *E718*
143-
A Funcref variable is obtained with the |function()| function. It can be used
144-
in an expression in the place of a function name, before the parenthesis
145-
around the arguments, to invoke the function it refers to. Example: >
143+
A Funcref variable is obtained with the |function()| function or created with
144+
the lambda expression |expr-lambda|. It can be used in an expression in the
145+
place of a function name, before the parenthesis around the arguments, to
146+
invoke the function it refers to. Example: >
146147
147148
:let Fn = function("MyFunc")
148149
:echo Fn()
@@ -694,6 +695,7 @@ Expression syntax summary, from least to most significant:
694695
@r contents of register 'r'
695696
function(expr1, ...) function call
696697
func{ti}on(expr1, ...) function call with curly braces
698+
{args -> expr1} lambda expression
697699

698700

699701
".." indicates that the operations in this level can be concatenated.
@@ -1207,6 +1209,42 @@ function(expr1, ...) function call
12071209
See below |functions|.
12081210

12091211

1212+
lambda expression *expr-lambda* *lambda*
1213+
-----------------
1214+
{args -> expr1} lambda expression
1215+
1216+
A lambda expression creates a new unnamed function which returns the result of
1217+
evaluating |expr1|. Lambda expressions differ from |user-functions| in
1218+
the following ways:
1219+
1220+
1. The body of the lambda expression is an |expr1| and not a sequence of |Ex|
1221+
commands.
1222+
2. The prefix "a:" is optional for arguments. E.g.: >
1223+
:let F = {arg1, arg2 -> arg1 - arg2}
1224+
:echo F(5, 2)
1225+
< 3
1226+
1227+
The arguments are optional. Example: >
1228+
:let F = {-> 'error function'}
1229+
:echo F()
1230+
< error function
1231+
1232+
Examples for using a lambda expression with |sort()|, |map()| and |filter()|: >
1233+
:echo map([1, 2, 3], {idx, val -> val + 1})
1234+
< [2, 3, 4] >
1235+
:echo sort([3,7,2,1,4], {a, b -> a - b})
1236+
< [1, 2, 3, 4, 7]
1237+
1238+
The lambda expression is also useful for Channel, Job and timer: >
1239+
:let timer = timer_start(500,
1240+
\ {-> execute("echo 'Handler called'", "")},
1241+
\ {'repeat': 3})
1242+
< Handler called
1243+
Handler called
1244+
Handler called
1245+
1246+
Note how execute() is used to execute an Ex command. That's ugly though.
1247+
12101248
==============================================================================
12111249
3. Internal variable *internal-variables* *E461*
12121250

@@ -1876,7 +1914,7 @@ USAGE RESULT DESCRIPTION ~
18761914
abs({expr}) Float or Number absolute value of {expr}
18771915
acos({expr}) Float arc cosine of {expr}
18781916
add({list}, {item}) List append {item} to |List| {list}
1879-
and({expr}, {expr}) Number bitwise AND
1917+
and({expr}, {expr}) Number bitwise AND
18801918
append({lnum}, {string}) Number append {string} below line {lnum}
18811919
append({lnum}, {list}) Number append lines {list} below line {lnum}
18821920
argc() Number number of files in the argument list
@@ -1894,7 +1932,7 @@ assert_notmatch({pat}, {text} [, {msg}]) none assert {pat} not matches {text}
18941932
assert_true({actual} [, {msg}]) none assert {actual} is true
18951933
asin({expr}) Float arc sine of {expr}
18961934
atan({expr}) Float arc tangent of {expr}
1897-
atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2}
1935+
atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2}
18981936
browse({save}, {title}, {initdir}, {default})
18991937
String put up a file requester
19001938
browsedir({title}, {initdir}) String put up a directory requester
@@ -1918,21 +1956,21 @@ ch_evalraw({handle}, {string} [, {options}])
19181956
any evaluate {string} on raw {handle}
19191957
ch_getbufnr({handle}, {what}) Number get buffer number for {handle}/{what}
19201958
ch_getjob({channel}) Job get the Job of {channel}
1921-
ch_info({handle}) String info about channel {handle}
1959+
ch_info({handle}) String info about channel {handle}
19221960
ch_log({msg} [, {handle}]) none write {msg} in the channel log file
19231961
ch_logfile({fname} [, {mode}]) none start logging channel activity
19241962
ch_open({address} [, {options}])
1925-
Channel open a channel to {address}
1926-
ch_read({handle} [, {options}]) String read from {handle}
1963+
Channel open a channel to {address}
1964+
ch_read({handle} [, {options}]) String read from {handle}
19271965
ch_readraw({handle} [, {options}])
1928-
String read raw from {handle}
1966+
String read raw from {handle}
19291967
ch_sendexpr({handle}, {expr} [, {options}])
19301968
any send {expr} over JSON {handle}
19311969
ch_sendraw({handle}, {string} [, {options}])
19321970
any send {string} over raw {handle}
19331971
ch_setoptions({handle}, {options})
19341972
none set options for {handle}
1935-
ch_status({handle}) String status of channel {handle}
1973+
ch_status({handle}) String status of channel {handle}
19361974
changenr() Number current change number
19371975
char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
19381976
cindent({lnum}) Number C indent for line {lnum}
@@ -1947,7 +1985,7 @@ copy({expr}) any make a shallow copy of {expr}
19471985
cos({expr}) Float cosine of {expr}
19481986
cosh({expr}) Float hyperbolic cosine of {expr}
19491987
count({list}, {expr} [, {ic} [, {start}]])
1950-
Number count how many {expr} are in {list}
1988+
Number count how many {expr} are in {list}
19511989
cscope_connection([{num} , {dbpath} [, {prepend}]])
19521990
Number checks existence of cscope connection
19531991
cursor({lnum}, {col} [, {off}])
@@ -1964,7 +2002,7 @@ eval({string}) any evaluate {string} into its value
19642002
eventhandler() Number |TRUE| if inside an event handler
19652003
executable({expr}) Number 1 if executable {expr} exists
19662004
execute({command}) String execute {command} and get the output
1967-
exepath({expr}) String full path of the command {expr}
2005+
exepath({expr}) String full path of the command {expr}
19682006
exists({expr}) Number |TRUE| if {expr} exists
19692007
extend({expr1}, {expr2} [, {expr3}])
19702008
List/Dict insert items of {expr2} into {expr1}
@@ -1992,7 +2030,7 @@ foldtext() String line displayed for closed fold
19922030
foldtextresult({lnum}) String text for closed fold at {lnum}
19932031
foreground() Number bring the Vim window to the foreground
19942032
function({name} [, {arglist}] [, {dict}])
1995-
Funcref reference to function {name}
2033+
Funcref reference to function {name}
19962034
garbagecollect([{atexit}]) none free memory, breaking cyclic references
19972035
get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
19982036
get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
@@ -2036,7 +2074,7 @@ getwinvar({nr}, {varname} [, {def}])
20362074
any variable {varname} in window {nr}
20372075
glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])
20382076
any expand file wildcards in {expr}
2039-
glob2regpat({expr}) String convert a glob pat into a search pat
2077+
glob2regpat({expr}) String convert a glob pat into a search pat
20402078
globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
20412079
String do glob({expr}) for all dirs in {path}
20422080
has({feature}) Number |TRUE| if feature {feature} supported
@@ -2059,22 +2097,22 @@ index({list}, {expr} [, {start} [, {ic}]])
20592097
input({prompt} [, {text} [, {completion}]])
20602098
String get input from the user
20612099
inputdialog({prompt} [, {text} [, {completion}]]])
2062-
String like input() but in a GUI dialog
2100+
String like input() but in a GUI dialog
20632101
inputlist({textlist}) Number let the user pick from a choice list
20642102
inputrestore() Number restore typeahead
20652103
inputsave() Number save and clear typeahead
2066-
inputsecret({prompt} [, {text}]) String like input() but hiding the text
2104+
inputsecret({prompt} [, {text}]) String like input() but hiding the text
20672105
insert({list}, {item} [, {idx}]) List insert {item} in {list} [before {idx}]
2068-
invert({expr}) Number bitwise invert
2106+
invert({expr}) Number bitwise invert
20692107
isdirectory({directory}) Number |TRUE| if {directory} is a directory
20702108
islocked({expr}) Number |TRUE| if {expr} is locked
2071-
isnan({expr}) Number |TRUE| if {expr} is NaN
2109+
isnan({expr}) Number |TRUE| if {expr} is NaN
20722110
items({dict}) List key-value pairs in {dict}
20732111
job_getchannel({job}) Channel get the channel handle for {job}
20742112
job_info({job}) Dict get information about {job}
20752113
job_setoptions({job}, {options}) none set options for {job}
20762114
job_start({command} [, {options}])
2077-
Job start a job
2115+
Job start a job
20782116
job_status({job}) String get the status of {job}
20792117
job_stop({job} [, {how}]) Number stop {job}
20802118
join({list} [, {sep}]) String join {list} items into one String
@@ -2085,7 +2123,7 @@ json_encode({expr}) String encode JSON
20852123
keys({dict}) List keys in {dict}
20862124
len({expr}) Number the length of {expr}
20872125
libcall({lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
2088-
libcallnr({lib}, {func}, {arg}) Number idem, but return a Number
2126+
libcallnr({lib}, {func}, {arg}) Number idem, but return a Number
20892127
line({expr}) Number line nr of cursor, last line or mark
20902128
line2byte({lnum}) Number byte count of line {lnum}
20912129
lispindent({lnum}) Number Lisp indent for line {lnum}
@@ -2123,7 +2161,7 @@ mode([expr]) String current editing mode
21232161
mzeval({expr}) any evaluate |MzScheme| expression
21242162
nextnonblank({lnum}) Number line nr of non-blank line >= {lnum}
21252163
nr2char({expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
2126-
or({expr}, {expr}) Number bitwise OR
2164+
or({expr}, {expr}) Number bitwise OR
21272165
pathshorten({expr}) String shorten directory names in a path
21282166
perleval({expr}) any evaluate |Perl| expression
21292167
pow({x}, {y}) Float {x} to the power of {y}
@@ -2231,7 +2269,7 @@ synID({lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col}
22312269
synIDattr({synID}, {what} [, {mode}])
22322270
String attribute {what} of syntax ID {synID}
22332271
synIDtrans({synID}) Number translated syntax ID of {synID}
2234-
synconcealed({lnum}, {col}) List info about concealing
2272+
synconcealed({lnum}, {col}) List info about concealing
22352273
synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
22362274
system({expr} [, {input}]) String output of shell command/filter {expr}
22372275
systemlist({expr} [, {input}]) List output of shell command/filter {expr}
@@ -2288,7 +2326,7 @@ winwidth({nr}) Number width of window {nr}
22882326
wordcount() Dict get byte/char/word statistics
22892327
writefile({list}, {fname} [, {flags}])
22902328
Number write list of lines to file {fname}
2291-
xor({expr}, {expr}) Number bitwise XOR
2329+
xor({expr}, {expr}) Number bitwise XOR
22922330

22932331

22942332
abs({expr}) *abs()*
@@ -3278,7 +3316,8 @@ execute({command} [, {silent}]) *execute()*
32783316
"silent" `:silent` used
32793317
"silent!" `:silent!` used
32803318
The default is 'silent'. Note that with "silent!", unlike
3281-
`:redir`, error messages are dropped.
3319+
`:redir`, error messages are dropped. When using an external
3320+
command the screen may be messed up, use `system()` instead.
32823321
*E930*
32833322
It is not possible to use `:redir` anywhere in {command}.
32843323

@@ -7202,7 +7241,8 @@ system({expr} [, {input}]) *system()* *E677*
72027241
in a way |writefile()| does with {binary} set to "b" (i.e.
72037242
with a newline between each list item with newlines inside
72047243
list items converted to NULs).
7205-
Pipes are not used.
7244+
7245+
Pipes are not used, the 'shelltemp' option is not used.
72067246

72077247
When prepended by |:silent| the shell will not be set to
72087248
cooked mode. This is meant to be used for commands that do
@@ -7894,8 +7934,6 @@ diff Compiled with |vimdiff| and 'diff' support.
78947934
digraphs Compiled with support for digraphs.
78957935
directx Compiled with support for Direct-X and 'renderoptions'.
78967936
dnd Compiled with support for the "~ register |quote_~|.
7897-
dos16 16 bits DOS version of Vim.
7898-
dos32 32 bits DOS (DJGPP) version of Vim.
78997937
ebcdic Compiled on a machine with ebcdic character set.
79007938
emacs_tags Compiled with support for Emacs tags.
79017939
eval Compiled with expression evaluation support. Always
@@ -7971,7 +8009,6 @@ netbeans_intg Compiled with support for |netbeans|.
79718009
num64 Compiled with 64-bit |Number| support.
79728010
odbeditor Compiled with |odbeditor| support.
79738011
ole Compiled with OLE automation support for Win32.
7974-
os2 OS/2 version of Vim.
79758012
packages Compiled with |packages| support.
79768013
path_extra Compiled with up/downwards search in 'path' and 'tags'
79778014
perl Compiled with Perl interface.
@@ -8208,10 +8245,10 @@ can be 0). "a:000" is set to a |List| that contains these arguments. Note
82088245
that "a:1" is the same as "a:000[0]".
82098246
*E742*
82108247
The a: scope and the variables in it cannot be changed, they are fixed.
8211-
However, if a |List| or |Dictionary| is used, you can change their contents.
8212-
Thus you can pass a |List| to a function and have the function add an item to
8213-
it. If you want to make sure the function cannot change a |List| or
8214-
|Dictionary| use |:lockvar|.
8248+
However, if a composite type is used, such as |List| or |Dictionary| , you can
8249+
change their contents. Thus you can pass a |List| to a function and have the
8250+
function add an item to it. If you want to make sure the function cannot
8251+
change a |List| or |Dictionary| use |:lockvar|.
82158252

82168253
When not using "...", the number of arguments in a function call must be equal
82178254
to the number of named arguments. When using "...", the number of arguments
@@ -8223,9 +8260,8 @@ until the matching |:endfunction|. It is allowed to define another function
82238260
inside a function body.
82248261

82258262
*local-variables*
8226-
Inside a function variables can be used. These are local variables, which
8227-
will disappear when the function returns. Global variables need to be
8228-
accessed with "g:".
8263+
Inside a function local variables can be used. These will disappear when the
8264+
function returns. Global variables need to be accessed with "g:".
82298265

82308266
Example: >
82318267
:function Table(title, ...)

runtime/doc/index.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*index.txt* For Vim version 7.4. Last change: 2016 Jun 12
1+
*index.txt* For Vim version 7.4. Last change: 2016 Jul 16
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1157,6 +1157,7 @@ tag command action ~
11571157
|:chdir| :chd[ir] change directory
11581158
|:checkpath| :che[ckpath] list included files
11591159
|:checktime| :checkt[ime] check timestamp of loaded buffers
1160+
|:chistory| :chi[story] list the error lists
11601161
|:clast| :cla[st] go to the specified error, default last one
11611162
|:clearjumps| :cle[arjumps] clear the jump list
11621163
|:clist| :cl[ist] list all errors
@@ -1320,6 +1321,7 @@ tag command action ~
13201321
|:lgrep| :lgr[ep] run 'grepprg' and jump to first match
13211322
|:lgrepadd| :lgrepa[dd] like :grep, but append to current list
13221323
|:lhelpgrep| :lh[elpgrep] like ":helpgrep" but uses location list
1324+
|:lhistory| :lhi[story] list the location lists
13231325
|:ll| :ll go to specific location
13241326
|:llast| :lla[st] go to the specified location, default last one
13251327
|:llist| :lli[st] list all locations

0 commit comments

Comments
 (0)