Skip to content

Commit bdc8cf3

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents bd8b60d + a3dc5e9 commit bdc8cf3

33 files changed

Lines changed: 744 additions & 146 deletions

runtime/doc/eval.txt

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2016 Mar 14
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Mar 15
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -350,10 +350,6 @@ This works like: >
350350
: let index = index + 1
351351
:endwhile
352352
353-
Note that all items in the list should be of the same type, otherwise this
354-
results in error |E706|. To avoid this |:unlet| the variable at the end of
355-
the loop.
356-
357353
If all you want to do is modify each item in the list then the |map()|
358354
function will be a simpler method than a for loop.
359355

@@ -2133,9 +2129,12 @@ tabpagewinnr( {tabarg}[, {arg}])
21332129
Number number of current window in tab page
21342130
taglist( {expr}) List list of tags matching {expr}
21352131
tagfiles() List tags files used
2136-
tempname() String name for a temporary file
21372132
tan( {expr}) Float tangent of {expr}
21382133
tanh( {expr}) Float hyperbolic tangent of {expr}
2134+
tempname() String name for a temporary file
2135+
timer_start( {time}, {callback} [, {options}])
2136+
Number create a timer
2137+
timer_stop( {timer}) none stop a timer
21392138
tolower( {expr}) String the String {expr} switched to lowercase
21402139
toupper( {expr}) String the String {expr} switched to uppercase
21412140
tr( {src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
@@ -3572,8 +3571,15 @@ foreground() Move the Vim window to the foreground. Useful when sent from
35723571
*function()* *E700* *E922* *E923*
35733572
function({name} [, {arglist}] [, {dict}])
35743573
Return a |Funcref| variable that refers to function {name}.
3575-
{name} can be a user defined function or an internal function.
3576-
3574+
{name} can be the name of a user defined function or an
3575+
internal function.
3576+
3577+
{name} can also be a Funcref, also a partial. When it is a
3578+
partial the dict stored in it will be used and the {dict}
3579+
argument is not allowed. E.g.: >
3580+
let FuncWithArg = function(dict.Func, [arg])
3581+
let Broken = function(dict.Func, [arg], dict)
3582+
<
35773583
When {arglist} or {dict} is present this creates a partial.
35783584
That mans the argument list and/or the dictionary is stored in
35793585
the Funcref and will be used when the Funcref is called.
@@ -3598,6 +3604,10 @@ function({name} [, {arglist}] [, {dict}])
35983604
let Func = function('Callback', context)
35993605
...
36003606
call Func() " will echo: called for example
3607+
< The use of function() is not needed when there are no extra
3608+
arguments, these two are equivalent: >
3609+
let Func = function('Callback', context)
3610+
let Func = context.Callback
36013611
36023612
< The argument list and the Dictionary can be combined: >
36033613
function Callback(arg1, count) dict
@@ -4523,13 +4533,13 @@ job_info({job}) *job_info()*
45234533
"status" what |job_status()| returns
45244534
"channel" what |job_getchannel()| returns
45254535
"exitval" only valid when "status" is "dead"
4526-
"exit-cb" function to be called on exit
4536+
"exit_cb" function to be called on exit
45274537
"stoponexit" |job-stoponexit|
45284538

45294539
job_setoptions({job}, {options}) *job_setoptions()*
45304540
Change options for {job}. Supported are:
45314541
"stoponexit" |job-stoponexit|
4532-
"exit-cb" |job-exit-cb|
4542+
"exit_cb" |job-exit_cb|
45334543

45344544
job_start({command} [, {options}]) *job_start()*
45354545
Start a job and return a Job object. Unlike |system()| and
@@ -6897,8 +6907,7 @@ systemlist({expr} [, {input}]) *systemlist()*
68976907
is the same as |readfile()| will output with {binary} argument
68986908
set to "b".
68996909

6900-
Returns an empty string on error, so be careful not to run
6901-
into |E706|.
6910+
Returns an empty string on error.
69026911

69036912

69046913
tabpagebuflist([{arg}]) *tabpagebuflist()*
@@ -7014,6 +7023,33 @@ tanh({expr}) *tanh()*
70147023
{only available when compiled with the |+float| feature}
70157024

70167025

7026+
*timer_start()*
7027+
timer_start({time}, {callback} [, {options}])
7028+
Create a timer and return the timer ID.
7029+
7030+
{time} is the waiting time in milliseconds. This is the
7031+
minimum time before invoking the callback. When the system is
7032+
busy or Vim is not waiting for input the time will be longer.
7033+
7034+
{callback} is the function to call. It can be the name of a
7035+
function or a Funcref. It is called with one argument, which
7036+
is the timer ID. The callback is only invoked when Vim is
7037+
waiting for input.
7038+
7039+
{options} is a dictionary. Supported entries:
7040+
"repeat" Number of times to repeat calling the
7041+
callback. -1 means forever.
7042+
7043+
Example: >
7044+
func MyHandler(timer)
7045+
echo 'Handler called'
7046+
endfunc
7047+
let timer = timer_start(500, 'MyHandler',
7048+
\ {'repeat': 3})
7049+
< This will invoke MyHandler() three times at 500 msec
7050+
intervals.
7051+
{only available when compiled with the |+timers| feature}
7052+
70177053
tolower({expr}) *tolower()*
70187054
The result is a copy of the String given, with all uppercase
70197055
characters turned into lowercase (just like applying |gu| to
@@ -7573,6 +7609,7 @@ termresponse Compiled with support for |t_RV| and |v:termresponse|.
75737609
textobjects Compiled with support for |text-objects|.
75747610
tgetent Compiled with tgetent support, able to use a termcap
75757611
or terminfo file.
7612+
timers Compiled with |timer_start()| support.
75767613
title Compiled with window title support |'title'|.
75777614
toolbar Compiled with support for |gui-toolbar|.
75787615
transparency Compiled with 'transparency' support.

runtime/doc/options.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6669,7 +6669,9 @@ A jump table for the options with a short description can be found at |Q_op|.
66696669
c don't give |ins-completion-menu| messages. For example,
66706670
"-- XXX completion (YYY)", "match 1 of 2", "The only match",
66716671
"Pattern not found", "Back at original", etc.
6672-
q use "recording" instead of "recording @a"
6672+
q use "recording" instead of "recording @a"
6673+
F don't give the file info when editing a file, like `:silent`
6674+
was used for the command
66736675

66746676
This gives you the opportunity to avoid that a change between buffers
66756677
requires you to hit <Enter>, but still gives as useful a message as

src/buffer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,19 @@ open_buffer(
139139
#endif
140140
)
141141
{
142+
int old_msg_silent = msg_silent;
143+
142144
#ifdef FEAT_NETBEANS_INTG
143145
int oldFire = netbeansFireChanges;
144146

145147
netbeansFireChanges = 0;
146148
#endif
149+
if (shortmess(SHM_FILEINFO))
150+
msg_silent = 1;
147151
retval = readfile(curbuf->b_ffname, curbuf->b_fname,
148152
(linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, eap,
149153
flags | READ_NEW);
154+
msg_silent = old_msg_silent;
150155
#ifdef FEAT_NETBEANS_INTG
151156
netbeansFireChanges = oldFire;
152157
#endif

src/channel.c

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,19 +1304,7 @@ invoke_callback(channel_T *channel, char_u *callback, partial_T *partial,
13041304
&rettv, 2, argv, 0L, 0L, &dummy, TRUE, partial, NULL);
13051305
clear_tv(&rettv);
13061306

1307-
/* If an echo command was used the cursor needs to be put back where
1308-
* it belongs. If highlighting was changed a redraw is needed. */
1309-
update_screen(0);
1310-
setcursor();
1311-
cursor_on();
1312-
out_flush();
1313-
#ifdef FEAT_GUI
1314-
if (gui.in_use)
1315-
{
1316-
gui_update_cursor(TRUE, FALSE);
1317-
gui_mch_flush();
1318-
}
1319-
#endif
1307+
redraw_after_callback();
13201308
}
13211309

13221310
/*
@@ -3043,28 +3031,6 @@ channel_get_timeout(channel_T *channel, int part)
30433031
return channel->ch_part[part].ch_timeout;
30443032
}
30453033

3046-
/*
3047-
* Get a callback from "arg". It can be a Funcref or a function name.
3048-
* When "arg" is zero return an empty string.
3049-
* Return NULL for an invalid argument.
3050-
*/
3051-
static char_u *
3052-
get_callback(typval_T *arg, partial_T **pp)
3053-
{
3054-
if (arg->v_type == VAR_PARTIAL && arg->vval.v_partial != NULL)
3055-
{
3056-
*pp = arg->vval.v_partial;
3057-
return (*pp)->pt_name;
3058-
}
3059-
*pp = NULL;
3060-
if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING)
3061-
return arg->vval.v_string;
3062-
if (arg->v_type == VAR_NUMBER && arg->vval.v_number == 0)
3063-
return (char_u *)"";
3064-
EMSG(_("E921: Invalid callback argument"));
3065-
return NULL;
3066-
}
3067-
30683034
static int
30693035
handle_mode(typval_T *item, jobopt_T *opt, ch_mode_T *modep, int jo)
30703036
{

0 commit comments

Comments
 (0)