diff runtime/doc/eval.txt @ 9810:6a28d0c6f929 v7.4.2180

commit https://github.com/vim/vim/commit/b73598e2f022a22fec512ea681c70d2775e8fd87 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 7 18:22:53 2016 +0200 patch 7.4.2180 Problem: There is no easy way to stop all timers. There is no way to temporary pause a timer. Solution: Add timer_stopall() and timer_pause().
author Christian Brabandt <cb@256bit.org>
date Sun, 07 Aug 2016 18:30:05 +0200
parents 34cc6a101340
children 67781bb0a61a
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2016 Aug 06
+*eval.txt*	For Vim version 7.4.  Last change: 2016 Aug 07
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1969,7 +1969,7 @@ assert_exception({error} [, {msg}])     
 assert_fails({cmd} [, {error}])          none  assert {cmd} fails
 assert_false({actual} [, {msg}])         none  assert {actual} is false
 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_notequal({exp}, {act} [, {msg}])  none  assert {exp} is not equal {act}
 assert_notmatch({pat}, {text} [, {msg}]) none  assert {pat} not matches {text}
@@ -2340,9 +2340,11 @@ test_null_partial()		Funcref	null value 
 test_null_string()		String	null value for testing
 test_settime({expr})		none	set current time for testing
 timer_info([{id}])		List	information about timers
+timer_pause({id}, {pause})	none	pause or unpause a timer
 timer_start({time}, {callback} [, {options}])
 				Number	create a timer
 timer_stop({timer})		none	stop a timer
+timer_stopall()			none	stop all timers
 tolower({expr})			String	the String {expr} switched to lowercase
 toupper({expr})			String	the String {expr} switched to uppercase
 tr({src}, {fromstr}, {tostr})	String	translate chars of {src} in {fromstr}
@@ -7555,8 +7557,26 @@ timer_info([{id}])
 		    "time"	    time the timer was started with
 		    "remaining"	    time until the timer fires
 		    "repeat"	    number of times the timer will still fire;
-		    		    -1 means forever
+				    -1 means forever
 		    "callback"	    the callback
+		    "paused"	    1 if the timer is paused, 0 otherwise
+
+		{only available when compiled with the |+timers| feature}
+
+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|.
+
+		{only available when compiled with the |+timers| feature}
 
 							*timer_start()*
 timer_start({time}, {callback} [, {options}])
@@ -7583,6 +7603,7 @@ timer_start({time}, {callback} [, {optio
 				\ {'repeat': 3})
 <		This will invoke MyHandler() three times at 500 msec
 		intervals.
+
 		{only available when compiled with the |+timers| feature}
 
 timer_stop({timer})					*timer_stop()*
@@ -7590,6 +7611,15 @@ timer_stop({timer})					*timer_stop()*
 		{timer} is an ID returned by timer_start(), thus it must be a
 		Number.  If {timer} does not exist there is no error.
 
+		{only available when compiled with the |+timers| feature}
+
+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.
+
+		{only available when compiled with the |+timers| feature}
+
 tolower({expr})						*tolower()*
 		The result is a copy of the String given, with all uppercase
 		characters turned into lowercase (just like applying |gu| to