| To: vim_dev@googlegroups.com |
| Subject: Patch 7.4.306 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.4.306 |
| Problem: getchar(0) does not return Esc. |
| Solution: Do not wait for an Esc sequence to be complete. (Yasuhiro |
| Matsumoto) |
| Files: src/eval.c, src/getchar.c |
| |
| |
| |
| |
| |
| *** 11313,11325 **** |
| n = safe_vgetc(); |
| else if (get_tv_number_chk(&argvars[0], &error) == 1) |
| /* getchar(1): only check if char avail */ |
| ! n = vpeekc(); |
| ! else if (error || vpeekc() == NUL) |
| /* illegal argument or getchar(0) and no char avail: return zero */ |
| n = 0; |
| else |
| /* getchar(0) and char avail: return char */ |
| n = safe_vgetc(); |
| if (n == K_IGNORE) |
| continue; |
| break; |
| --- 11313,11326 ---- |
| n = safe_vgetc(); |
| else if (get_tv_number_chk(&argvars[0], &error) == 1) |
| /* getchar(1): only check if char avail */ |
| ! n = vpeekc_any(); |
| ! else if (error || vpeekc_any() == NUL) |
| /* illegal argument or getchar(0) and no char avail: return zero */ |
| n = 0; |
| else |
| /* getchar(0) and char avail: return char */ |
| n = safe_vgetc(); |
| + |
| if (n == K_IGNORE) |
| continue; |
| break; |
| |
| |
| |
| *** 1883,1889 **** |
| } |
| #endif |
| |
| ! #if defined(FEAT_INS_EXPAND) || defined(PROTO) |
| /* |
| * Check if any character is available, also half an escape sequence. |
| * Trick: when no typeahead found, but there is something in the typeahead |
| --- 1883,1889 ---- |
| } |
| #endif |
| |
| ! #if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || defined(PROTO) |
| /* |
| * Check if any character is available, also half an escape sequence. |
| * Trick: when no typeahead found, but there is something in the typeahead |
| |
| |
| |
| *** 736,737 **** |
| --- 736,739 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 306, |
| /**/ |
| |
| -- |
| Press any key to continue, press any other key to quit. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |