summaryrefslogtreecommitdiffstats
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-09-05 18:57:57 +0000
committerBram Moolenaar <Bram@vim.org>2006-09-05 18:57:57 +0000
commit4395a71d2c1a07f648b38f0962e12e880fc0e642 (patch)
tree36a19245ad08b2aeba5b5ff2b655215b828651e7 /src/misc1.c
parent1f788e7c432f993d38c7fba763f06ab96f7d93cb (diff)
updated for version 7.0-090v7.0.090
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 78caa2081f..b74ce0de48 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3016,6 +3016,7 @@ get_keystroke()
int len = 0;
int n;
int save_mapped_ctrl_c = mapped_ctrl_c;
+ int waited = 0;
mapped_ctrl_c = FALSE; /* mappings are not used here */
for (;;)
@@ -3034,11 +3035,16 @@ get_keystroke()
/* Replace zero and CSI by a special key code. */
n = fix_input_buffer(buf + len, n, FALSE);
len += n;
+ waited = 0;
}
+ else if (len > 0)
+ ++waited; /* keep track of the waiting time */
- /* incomplete termcode: get more characters */
- if ((n = check_termcode(1, buf, len)) < 0)
+ /* Incomplete termcode and not timed out yet: get more characters */
+ if ((n = check_termcode(1, buf, len)) < 0
+ && (!p_ttimeout || waited * 100L < (p_ttm < 0 ? p_tm : p_ttm)))
continue;
+
/* found a termcode: adjust length */
if (n > 0)
len = n;