mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 23:08:16 +00:00
Merge #6219 from jbradaric/vim-7.4.2170
vim-patch:7.4.{2170,2180,2240,2241,2242}
This commit is contained in:
@@ -1952,7 +1952,7 @@ assert_exception( {error} [, {msg}]) none assert {error} is in v:exception
|
|||||||
assert_fails( {cmd} [, {error}]) none assert {cmd} fails
|
assert_fails( {cmd} [, {error}]) none assert {cmd} fails
|
||||||
assert_false({actual} [, {msg}]) none assert {actual} is false
|
assert_false({actual} [, {msg}]) none assert {actual} is false
|
||||||
assert_inrange({lower}, {upper}, {actual} [, {msg}])
|
assert_inrange({lower}, {upper}, {actual} [, {msg}])
|
||||||
none assert {actual} is inside the range
|
none assert {actual} is inside the range
|
||||||
assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text}
|
assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text}
|
||||||
assert_notequal( {exp}, {act} [, {msg}]) none assert {exp} is not equal {act}
|
assert_notequal( {exp}, {act} [, {msg}]) none assert {exp} is not equal {act}
|
||||||
assert_notmatch( {pat}, {text} [, {msg}]) none assert {pat} not matches {text}
|
assert_notmatch( {pat}, {text} [, {msg}]) none assert {pat} not matches {text}
|
||||||
@@ -2302,9 +2302,12 @@ tan({expr}) Float tangent of {expr}
|
|||||||
tanh({expr}) Float hyperbolic tangent of {expr}
|
tanh({expr}) Float hyperbolic tangent of {expr}
|
||||||
tempname() String name for a temporary file
|
tempname() String name for a temporary file
|
||||||
test_garbagecollect_now() none free memory right now for testing
|
test_garbagecollect_now() none free memory right now for testing
|
||||||
|
timer_info([{id}]) List information about timers
|
||||||
|
timer_pause({id}, {pause}) none pause or unpause a timer
|
||||||
timer_start({time}, {callback} [, {options}])
|
timer_start({time}, {callback} [, {options}])
|
||||||
Number create a timer
|
Number create a timer
|
||||||
timer_stop({timer}) none stop a timer
|
timer_stop({timer}) none stop a timer
|
||||||
|
timer_stopall() none stop all timers
|
||||||
tolower({expr}) String the String {expr} switched to lowercase
|
tolower({expr}) String the String {expr} switched to lowercase
|
||||||
toupper({expr}) String the String {expr} switched to uppercase
|
toupper({expr}) String the String {expr} switched to uppercase
|
||||||
tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
|
tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
|
||||||
@@ -3203,8 +3206,12 @@ exepath({expr}) *exepath()*
|
|||||||
|
|
||||||
*exists()*
|
*exists()*
|
||||||
exists({expr}) The result is a Number, which is |TRUE| if {expr} is
|
exists({expr}) The result is a Number, which is |TRUE| if {expr} is
|
||||||
defined, zero otherwise. The {expr} argument is a string,
|
defined, zero otherwise.
|
||||||
which contains one of these:
|
|
||||||
|
For checking for a supported feature use |has()|.
|
||||||
|
For checking if a file exists use |filereadable()|.
|
||||||
|
|
||||||
|
The {expr} argument is a string, which contains one of these:
|
||||||
&option-name Vim option (only checks if it exists,
|
&option-name Vim option (only checks if it exists,
|
||||||
not if it really works)
|
not if it really works)
|
||||||
+option-name Vim option that works.
|
+option-name Vim option that works.
|
||||||
@@ -3252,7 +3259,6 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is
|
|||||||
event and pattern.
|
event and pattern.
|
||||||
##event autocommand for this event is
|
##event autocommand for this event is
|
||||||
supported.
|
supported.
|
||||||
For checking for a supported feature use |has()|.
|
|
||||||
|
|
||||||
Examples: >
|
Examples: >
|
||||||
exists("&mouse")
|
exists("&mouse")
|
||||||
@@ -5337,7 +5343,8 @@ matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]])
|
|||||||
available from |getmatches()|. All matches can be deleted in
|
available from |getmatches()|. All matches can be deleted in
|
||||||
one operation by |clearmatches()|.
|
one operation by |clearmatches()|.
|
||||||
|
|
||||||
matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()*
|
*matchaddpos()*
|
||||||
|
matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]])
|
||||||
Same as |matchadd()|, but requires a list of positions {pos}
|
Same as |matchadd()|, but requires a list of positions {pos}
|
||||||
instead of a pattern. This command is faster than |matchadd()|
|
instead of a pattern. This command is faster than |matchadd()|
|
||||||
because it does not require to handle regular expressions and
|
because it does not require to handle regular expressions and
|
||||||
@@ -7528,6 +7535,35 @@ tanh({expr}) *tanh()*
|
|||||||
< -0.761594
|
< -0.761594
|
||||||
|
|
||||||
|
|
||||||
|
*timer_info()*
|
||||||
|
timer_info([{id}])
|
||||||
|
Return a list with information about timers.
|
||||||
|
When {id} is given only information about this timer is
|
||||||
|
returned. When timer {id} does not exist an empty list is
|
||||||
|
returned.
|
||||||
|
When {id} is omitted information about all timers is returned.
|
||||||
|
|
||||||
|
For each timer the information is stored in a Dictionary with
|
||||||
|
these items:
|
||||||
|
"id" the timer ID
|
||||||
|
"time" time the timer was started with
|
||||||
|
"repeat" number of times the timer will still fire;
|
||||||
|
-1 means forever
|
||||||
|
"callback" the callback
|
||||||
|
|
||||||
|
timer_pause({timer}, {paused}) *timer_pause()*
|
||||||
|
Pause or unpause a timer. A paused timer does not invoke its
|
||||||
|
callback, while the time it would is not changed. Unpausing a
|
||||||
|
timer may cause the callback to be invoked almost immediately
|
||||||
|
if enough time has passed.
|
||||||
|
|
||||||
|
Pausing a timer is useful to avoid the callback to be called
|
||||||
|
for a short time.
|
||||||
|
|
||||||
|
If {paused} evaluates to a non-zero Number or a non-empty
|
||||||
|
String, then the timer is paused, otherwise it is unpaused.
|
||||||
|
See |non-zero-arg|.
|
||||||
|
|
||||||
*timer_start()*
|
*timer_start()*
|
||||||
timer_start({time}, {callback} [, {options}])
|
timer_start({time}, {callback} [, {options}])
|
||||||
Create a timer and return the timer ID.
|
Create a timer and return the timer ID.
|
||||||
@@ -7557,7 +7593,12 @@ timer_start({time}, {callback} [, {options}])
|
|||||||
timer_stop({timer}) *timer_stop()*
|
timer_stop({timer}) *timer_stop()*
|
||||||
Stop a timer. The timer callback will no longer be invoked.
|
Stop a timer. The timer callback will no longer be invoked.
|
||||||
{timer} is an ID returned by timer_start(), thus it must be a
|
{timer} is an ID returned by timer_start(), thus it must be a
|
||||||
Number.
|
Number. If {timer} does not exist there is no error.
|
||||||
|
|
||||||
|
timer_stopall() *timer_stopall()*
|
||||||
|
Stop all timers. The timer callbacks will no longer be
|
||||||
|
invoked. Useful if some timers is misbehaving. If there are
|
||||||
|
no timers there is no error.
|
||||||
|
|
||||||
tolower({expr}) *tolower()*
|
tolower({expr}) *tolower()*
|
||||||
The result is a copy of the String given, with all uppercase
|
The result is a copy of the String given, with all uppercase
|
||||||
|
@@ -462,6 +462,7 @@ typedef struct {
|
|||||||
int refcount;
|
int refcount;
|
||||||
long timeout;
|
long timeout;
|
||||||
bool stopped;
|
bool stopped;
|
||||||
|
bool paused;
|
||||||
Callback callback;
|
Callback callback;
|
||||||
} timer_T;
|
} timer_T;
|
||||||
|
|
||||||
@@ -16651,6 +16652,77 @@ static bool set_ref_in_callback(Callback *callback, int copyID,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void add_timer_info(typval_T *rettv, timer_T *timer)
|
||||||
|
{
|
||||||
|
list_T *list = rettv->vval.v_list;
|
||||||
|
dict_T *dict = tv_dict_alloc();
|
||||||
|
|
||||||
|
tv_list_append_dict(list, dict);
|
||||||
|
tv_dict_add_nr(dict, S_LEN("id"), timer->timer_id);
|
||||||
|
tv_dict_add_nr(dict, S_LEN("time"), timer->timeout);
|
||||||
|
tv_dict_add_nr(dict, S_LEN("paused"), timer->paused);
|
||||||
|
|
||||||
|
tv_dict_add_nr(dict, S_LEN("repeat"),
|
||||||
|
(timer->repeat_count < 0 ? -1 : timer->repeat_count));
|
||||||
|
|
||||||
|
dictitem_T *di = tv_dict_item_alloc("callback");
|
||||||
|
if (tv_dict_add(dict, di) == FAIL) {
|
||||||
|
xfree(di);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timer->callback.type == kCallbackPartial) {
|
||||||
|
di->di_tv.v_type = VAR_PARTIAL;
|
||||||
|
di->di_tv.vval.v_partial = timer->callback.data.partial;
|
||||||
|
timer->callback.data.partial->pt_refcount++;
|
||||||
|
} else if (timer->callback.type == kCallbackFuncref) {
|
||||||
|
di->di_tv.v_type = VAR_FUNC;
|
||||||
|
di->di_tv.vval.v_string = vim_strsave(timer->callback.data.funcref);
|
||||||
|
}
|
||||||
|
di->di_tv.v_lock = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void add_timer_info_all(typval_T *rettv)
|
||||||
|
{
|
||||||
|
timer_T *timer;
|
||||||
|
map_foreach_value(timers, timer, {
|
||||||
|
if (!timer->stopped) {
|
||||||
|
add_timer_info(rettv, timer);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// "timer_info([timer])" function
|
||||||
|
static void f_timer_info(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||||
|
{
|
||||||
|
tv_list_alloc_ret(rettv);
|
||||||
|
if (argvars[0].v_type != VAR_UNKNOWN) {
|
||||||
|
if (argvars[0].v_type != VAR_NUMBER) {
|
||||||
|
EMSG(_(e_number_exp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
timer_T *timer = pmap_get(uint64_t)(timers, tv_get_number(&argvars[0]));
|
||||||
|
if (timer != NULL && !timer->stopped) {
|
||||||
|
add_timer_info(rettv, timer);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
add_timer_info_all(rettv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// "timer_pause(timer, paused)" function
|
||||||
|
static void f_timer_pause(typval_T *argvars, typval_T *unused, FunPtr fptr)
|
||||||
|
{
|
||||||
|
if (argvars[0].v_type != VAR_NUMBER) {
|
||||||
|
EMSG(_(e_number_exp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int paused = (bool)tv_get_number(&argvars[1]);
|
||||||
|
timer_T *timer = pmap_get(uint64_t)(timers, tv_get_number(&argvars[0]));
|
||||||
|
if (timer != NULL) {
|
||||||
|
timer->paused = paused;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// "timer_start(timeout, callback, opts)" function
|
/// "timer_start(timeout, callback, opts)" function
|
||||||
static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||||
@@ -16685,6 +16757,7 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
timer = xmalloc(sizeof *timer);
|
timer = xmalloc(sizeof *timer);
|
||||||
timer->refcount = 1;
|
timer->refcount = 1;
|
||||||
timer->stopped = false;
|
timer->stopped = false;
|
||||||
|
timer->paused = false;
|
||||||
timer->repeat_count = repeat;
|
timer->repeat_count = repeat;
|
||||||
timer->timeout = timeout;
|
timer->timeout = timeout;
|
||||||
timer->timer_id = last_timer_id++;
|
timer->timer_id = last_timer_id++;
|
||||||
@@ -16694,8 +16767,7 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
timer->tw.events = multiqueue_new_child(main_loop.events);
|
timer->tw.events = multiqueue_new_child(main_loop.events);
|
||||||
// if main loop is blocked, don't queue up multiple events
|
// if main loop is blocked, don't queue up multiple events
|
||||||
timer->tw.blockable = true;
|
timer->tw.blockable = true;
|
||||||
time_watcher_start(&timer->tw, timer_due_cb, timeout,
|
time_watcher_start(&timer->tw, timer_due_cb, timeout, timeout);
|
||||||
timeout * (repeat != 1));
|
|
||||||
|
|
||||||
pmap_put(uint64_t)(timers, timer->timer_id, timer);
|
pmap_put(uint64_t)(timers, timer->timer_id, timer);
|
||||||
rettv->vval.v_number = timer->timer_id;
|
rettv->vval.v_number = timer->timer_id;
|
||||||
@@ -16719,13 +16791,19 @@ static void f_timer_stop(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
timer_stop(timer);
|
timer_stop(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void f_timer_stopall(typval_T *argvars, typval_T *unused, FunPtr fptr)
|
||||||
|
{
|
||||||
|
timer_stop_all();
|
||||||
|
}
|
||||||
|
|
||||||
// invoked on the main loop
|
// invoked on the main loop
|
||||||
static void timer_due_cb(TimeWatcher *tw, void *data)
|
static void timer_due_cb(TimeWatcher *tw, void *data)
|
||||||
{
|
{
|
||||||
timer_T *timer = (timer_T *)data;
|
timer_T *timer = (timer_T *)data;
|
||||||
if (timer->stopped) {
|
if (timer->stopped || timer->paused) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
timer->refcount++;
|
timer->refcount++;
|
||||||
// if repeat was negative repeat forever
|
// if repeat was negative repeat forever
|
||||||
if (timer->repeat_count >= 0 && --timer->repeat_count == 0) {
|
if (timer->repeat_count >= 0 && --timer->repeat_count == 0) {
|
||||||
@@ -16778,7 +16856,7 @@ static void timer_decref(timer_T *timer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_teardown(void)
|
static void timer_stop_all(void)
|
||||||
{
|
{
|
||||||
timer_T *timer;
|
timer_T *timer;
|
||||||
map_foreach_value(timers, timer, {
|
map_foreach_value(timers, timer, {
|
||||||
@@ -16786,6 +16864,11 @@ void timer_teardown(void)
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void timer_teardown(void)
|
||||||
|
{
|
||||||
|
timer_stop_all();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "tolower(string)" function
|
* "tolower(string)" function
|
||||||
*/
|
*/
|
||||||
|
@@ -306,8 +306,11 @@ return {
|
|||||||
tempname={},
|
tempname={},
|
||||||
termopen={args={1, 2}},
|
termopen={args={1, 2}},
|
||||||
test_garbagecollect_now={},
|
test_garbagecollect_now={},
|
||||||
|
timer_info={args={0,1}},
|
||||||
|
timer_pause={args=2},
|
||||||
timer_start={args={2,3}},
|
timer_start={args={2,3}},
|
||||||
timer_stop={args=1},
|
timer_stop={args=1},
|
||||||
|
timer_stopall={args=0},
|
||||||
tolower={args=1},
|
tolower={args=1},
|
||||||
toupper={args=1},
|
toupper={args=1},
|
||||||
tr={args=3},
|
tr={args=3},
|
||||||
|
@@ -4,8 +4,10 @@ if !has('timers')
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
source shared.vim
|
||||||
|
|
||||||
func MyHandler(timer)
|
func MyHandler(timer)
|
||||||
let s:val += 1
|
let g:val += 1
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func MyHandlerWithLists(lists, timer)
|
func MyHandlerWithLists(lists, timer)
|
||||||
@@ -13,44 +15,159 @@ func MyHandlerWithLists(lists, timer)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_oneshot()
|
func Test_oneshot()
|
||||||
let s:val = 0
|
let g:val = 0
|
||||||
let timer = timer_start(50, 'MyHandler')
|
let timer = timer_start(50, 'MyHandler')
|
||||||
sleep 200m
|
let slept = WaitFor('g:val == 1')
|
||||||
call assert_equal(1, s:val)
|
call assert_equal(1, g:val)
|
||||||
|
if has('reltime')
|
||||||
|
call assert_inrange(40, 100, slept)
|
||||||
|
else
|
||||||
|
call assert_inrange(20, 100, slept)
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_repeat_three()
|
func Test_repeat_three()
|
||||||
let s:val = 0
|
let g:val = 0
|
||||||
let timer = timer_start(50, 'MyHandler', {'repeat': 3})
|
let timer = timer_start(50, 'MyHandler', {'repeat': 3})
|
||||||
sleep 500m
|
let slept = WaitFor('g:val == 3')
|
||||||
call assert_equal(3, s:val)
|
call assert_equal(3, g:val)
|
||||||
|
if has('reltime')
|
||||||
|
call assert_inrange(120, 250, slept)
|
||||||
|
else
|
||||||
|
call assert_inrange(80, 200, slept)
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_repeat_many()
|
func Test_repeat_many()
|
||||||
let s:val = 0
|
let g:val = 0
|
||||||
let timer = timer_start(50, 'MyHandler', {'repeat': -1})
|
let timer = timer_start(50, 'MyHandler', {'repeat': -1})
|
||||||
sleep 200m
|
sleep 200m
|
||||||
call timer_stop(timer)
|
call timer_stop(timer)
|
||||||
call assert_true(s:val > 1)
|
call assert_inrange(2, 4, g:val)
|
||||||
call assert_true(s:val < 5)
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_with_partial_callback()
|
func Test_with_partial_callback()
|
||||||
let s:val = 0
|
let g:val = 0
|
||||||
let s:meow = {}
|
let meow = {'one': 1}
|
||||||
function s:meow.bite(...)
|
function meow.bite(...)
|
||||||
let s:val += 1
|
let g:val += self.one
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call timer_start(50, s:meow.bite)
|
call timer_start(50, meow.bite)
|
||||||
sleep 200m
|
let slept = WaitFor('g:val == 1')
|
||||||
call assert_equal(1, s:val)
|
call assert_equal(1, g:val)
|
||||||
|
if has('reltime')
|
||||||
|
call assert_inrange(40, 130, slept)
|
||||||
|
else
|
||||||
|
call assert_inrange(20, 100, slept)
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_retain_partial()
|
func Test_retain_partial()
|
||||||
call timer_start(100, function('MyHandlerWithLists', [['a']]))
|
call timer_start(50, function('MyHandlerWithLists', [['a']]))
|
||||||
call garbagecollect()
|
call garbagecollect()
|
||||||
sleep 200m
|
sleep 100m
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_info()
|
||||||
|
let id = timer_start(1000, 'MyHandler')
|
||||||
|
let info = timer_info(id)
|
||||||
|
call assert_equal(id, info[0]['id'])
|
||||||
|
call assert_equal(1000, info[0]['time'])
|
||||||
|
call assert_equal("function('MyHandler')", string(info[0]['callback']))
|
||||||
|
|
||||||
|
let found = 0
|
||||||
|
for info in timer_info()
|
||||||
|
if info['id'] == id
|
||||||
|
let found += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
call assert_equal(1, found)
|
||||||
|
|
||||||
|
call timer_stop(id)
|
||||||
|
call assert_equal([], timer_info(id))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_stopall()
|
||||||
|
let id1 = timer_start(1000, 'MyHandler')
|
||||||
|
let id2 = timer_start(2000, 'MyHandler')
|
||||||
|
let info = timer_info()
|
||||||
|
call assert_equal(2, len(info))
|
||||||
|
|
||||||
|
call timer_stopall()
|
||||||
|
let info = timer_info()
|
||||||
|
call assert_equal(0, len(info))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_paused()
|
||||||
|
let g:val = 0
|
||||||
|
|
||||||
|
let id = timer_start(50, 'MyHandler')
|
||||||
|
let info = timer_info(id)
|
||||||
|
call assert_equal(0, info[0]['paused'])
|
||||||
|
|
||||||
|
call timer_pause(id, 1)
|
||||||
|
let info = timer_info(id)
|
||||||
|
call assert_equal(1, info[0]['paused'])
|
||||||
|
sleep 200m
|
||||||
|
call assert_equal(0, g:val)
|
||||||
|
|
||||||
|
call timer_pause(id, 0)
|
||||||
|
let info = timer_info(id)
|
||||||
|
call assert_equal(0, info[0]['paused'])
|
||||||
|
|
||||||
|
let slept = WaitFor('g:val == 1')
|
||||||
|
call assert_equal(1, g:val)
|
||||||
|
if has('reltime')
|
||||||
|
call assert_inrange(0, 60, slept)
|
||||||
|
else
|
||||||
|
call assert_inrange(0, 10, slept)
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func StopMyself(timer)
|
||||||
|
let g:called += 1
|
||||||
|
if g:called == 2
|
||||||
|
call timer_stop(a:timer)
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_delete_myself()
|
||||||
|
let g:called = 0
|
||||||
|
let t = timer_start(10, 'StopMyself', {'repeat': -1})
|
||||||
|
call WaitFor('g:called == 2')
|
||||||
|
call assert_equal(2, g:called)
|
||||||
|
call assert_equal([], timer_info(t))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func StopTimer1(timer)
|
||||||
|
let g:timer2 = timer_start(10, 'StopTimer2')
|
||||||
|
" avoid maxfuncdepth error
|
||||||
|
call timer_pause(g:timer1, 1)
|
||||||
|
sleep 40m
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func StopTimer2(timer)
|
||||||
|
call timer_stop(g:timer1)
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_stop_in_callback()
|
||||||
|
let g:timer1 = timer_start(10, 'StopTimer1')
|
||||||
|
sleep 40m
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func StopTimerAll(timer)
|
||||||
|
call timer_stopall()
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_stop_all_in_callback()
|
||||||
|
let g:timer1 = timer_start(10, 'StopTimerAll')
|
||||||
|
let info = timer_info()
|
||||||
|
call assert_equal(1, len(info))
|
||||||
|
sleep 40m
|
||||||
|
let info = timer_info()
|
||||||
|
call assert_equal(0, len(info))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -82,7 +82,7 @@ static const int included_patches[] = {
|
|||||||
2362,
|
2362,
|
||||||
// 2361 NA
|
// 2361 NA
|
||||||
// 2360,
|
// 2360,
|
||||||
// 2359 NA
|
2359,
|
||||||
// 2358 NA
|
// 2358 NA
|
||||||
2357,
|
2357,
|
||||||
// 2356,
|
// 2356,
|
||||||
@@ -109,7 +109,7 @@ static const int included_patches[] = {
|
|||||||
2335,
|
2335,
|
||||||
2334,
|
2334,
|
||||||
2333,
|
2333,
|
||||||
// 2332 NA
|
2332,
|
||||||
2331,
|
2331,
|
||||||
2330,
|
2330,
|
||||||
2329,
|
2329,
|
||||||
@@ -137,7 +137,7 @@ static const int included_patches[] = {
|
|||||||
2307,
|
2307,
|
||||||
2306,
|
2306,
|
||||||
2305,
|
2305,
|
||||||
// 2304 NA
|
2304,
|
||||||
2303,
|
2303,
|
||||||
// 2302 NA
|
// 2302 NA
|
||||||
// 2301 NA
|
// 2301 NA
|
||||||
@@ -160,7 +160,7 @@ static const int included_patches[] = {
|
|||||||
2284,
|
2284,
|
||||||
2283,
|
2283,
|
||||||
// 2282 NA
|
// 2282 NA
|
||||||
// 2281 NA
|
2281,
|
||||||
2280,
|
2280,
|
||||||
2279,
|
2279,
|
||||||
// 2278 NA
|
// 2278 NA
|
||||||
@@ -199,9 +199,9 @@ static const int included_patches[] = {
|
|||||||
// 2245,
|
// 2245,
|
||||||
// 2244,
|
// 2244,
|
||||||
// 2243 NA
|
// 2243 NA
|
||||||
// 2242,
|
2242,
|
||||||
// 2241,
|
2241,
|
||||||
// 2240,
|
2240,
|
||||||
// 2239,
|
// 2239,
|
||||||
// 2238 NA
|
// 2238 NA
|
||||||
2237,
|
2237,
|
||||||
@@ -260,8 +260,8 @@ static const int included_patches[] = {
|
|||||||
2184,
|
2184,
|
||||||
2183,
|
2183,
|
||||||
// 2182 NA
|
// 2182 NA
|
||||||
// 2181,
|
// 2181 NA
|
||||||
// 2180,
|
2180,
|
||||||
// 2179,
|
// 2179,
|
||||||
2178,
|
2178,
|
||||||
2177,
|
2177,
|
||||||
@@ -270,8 +270,8 @@ static const int included_patches[] = {
|
|||||||
2174,
|
2174,
|
||||||
// 2173,
|
// 2173,
|
||||||
2172,
|
2172,
|
||||||
// 2171,
|
// 2171 NA
|
||||||
// 2170,
|
2170,
|
||||||
2169,
|
2169,
|
||||||
// 2168 NA
|
// 2168 NA
|
||||||
// 2167 NA
|
// 2167 NA
|
||||||
|
Reference in New Issue
Block a user