summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-08 22:37:34 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-08 22:37:34 +0200
commitc577d813b7978345dec4310b2d8f5d5624a681f6 (patch)
tree662bfda985692d778505c74d5c512201e1265362 /runtime
parent11e79bb04ea635d180dd79b1d5cbc755b56e66e1 (diff)
patch 8.0.0702: an error in a timer can make Vim unusablev8.0.0702
Problem: An error in a timer can make Vim unusable. Solution: Don't set the error flag or exception from a timer. Stop a timer if it causes an error 3 out of 3 times. Discard an exception caused inside a timer.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt18
1 files changed, 11 insertions, 7 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 03f59a9595..781c79af01 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.0. Last change: 2017 Jun 25
+*eval.txt* For Vim version 8.0. Last change: 2017 Jul 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4189,14 +4189,14 @@ getchar([expr]) *getchar()*
not consumed. Return zero if no character available.
Without [expr] and when [expr] is 0 a whole character or
- special key is returned. If it is an 8-bit character, the
+ special key is returned. If it is a single character, the
result is a number. Use nr2char() to convert it to a String.
Otherwise a String is returned with the encoded character.
- For a special key it's a sequence of bytes starting with 0x80
- (decimal: 128). This is the same value as the string
- "\<Key>", e.g., "\<Left>". The returned value is also a
- String when a modifier (shift, control, alt) was used that is
- not included in the character.
+ For a special key it's a String with a sequence of bytes
+ starting with 0x80 (decimal: 128). This is the same value as
+ the String "\<Key>", e.g., "\<Left>". The returned value is
+ also a String when a modifier (shift, control, alt) was used
+ that is not included in the character.
When [expr] is 0 and Esc is typed, there will be a short delay
while Vim waits to see if this is the start of an escape
@@ -8017,6 +8017,10 @@ timer_start({time}, {callback} [, {options}])
"repeat" Number of times to repeat calling the
callback. -1 means forever. When not present
the callback will be called once.
+ If the timer causes an error three times in a
+ row the repeat is cancelled. This avoids that
+ Vim becomes unusable because of all the error
+ messages.
Example: >
func MyHandler(timer)