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