Blame SOURCES/7.4.306

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