Blame SOURCES/7.4.207

22c937
To: vim_dev@googlegroups.com
22c937
Subject: Patch 7.4.207
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.207
22c937
Problem:    The cursor report sequence is sometimes not recognized and results
22c937
	    in entering replace mode.
22c937
Solution:   Also check for the cursor report when not asked for.
22c937
Files:	    src/term.c
22c937
22c937
22c937
*** ../vim-7.4.206/src/term.c	2013-09-29 16:27:42.000000000 +0200
22c937
--- src/term.c	2014-03-19 13:30:23.589874866 +0100
22c937
***************
22c937
*** 3379,3385 ****
22c937
  	 out_str(buf);
22c937
  	 out_str(T_U7);
22c937
  	 u7_status = U7_SENT;
22c937
! 	 term_windgoto(0, 0);
22c937
  	 out_str((char_u *)"  ");
22c937
  	 term_windgoto(0, 0);
22c937
  	 /* check for the characters now, otherwise they might be eaten by
22c937
--- 3379,3386 ----
22c937
  	 out_str(buf);
22c937
  	 out_str(T_U7);
22c937
  	 u7_status = U7_SENT;
22c937
! 	 out_flush();
22c937
! 	 term_windgoto(1, 0);
22c937
  	 out_str((char_u *)"  ");
22c937
  	 term_windgoto(0, 0);
22c937
  	 /* check for the characters now, otherwise they might be eaten by
22c937
***************
22c937
*** 4185,4208 ****
22c937
  			    || (tp[0] == CSI && len >= 2))
22c937
  			&& (VIM_ISDIGIT(*p) || *p == '>' || *p == '?'))
22c937
  	    {
22c937
  		j = 0;
22c937
  		extra = 0;
22c937
  		for (i = 2 + (tp[0] != CSI); i < len
22c937
  				&& !(tp[i] >= '{' && tp[i] <= '~')
22c937
  				&& !ASCII_ISALPHA(tp[i]); ++i)
22c937
  		    if (tp[i] == ';' && ++j == 1)
22c937
  			extra = i + 1;
22c937
  		if (i == len)
22c937
  		{
22c937
  		    LOG_TR("Not enough characters for CRV");
22c937
  		    return -1;
22c937
  		}
22c937
- 
22c937
  #ifdef FEAT_MBYTE
22c937
! 		/* Eat it when it has 2 arguments and ends in 'R'. Ignore it
22c937
! 		 * when u7_status is not "sent", <S-F3> sends something
22c937
! 		 * similar. */
22c937
! 		if (j == 1 && tp[i] == 'R' && u7_status == U7_SENT)
22c937
  		{
22c937
  		    char *aw = NULL;
22c937
  
22c937
--- 4186,4223 ----
22c937
  			    || (tp[0] == CSI && len >= 2))
22c937
  			&& (VIM_ISDIGIT(*p) || *p == '>' || *p == '?'))
22c937
  	    {
22c937
+ #ifdef FEAT_MBYTE
22c937
+ 		int col;
22c937
+ 		int row_char;
22c937
+ #endif
22c937
  		j = 0;
22c937
  		extra = 0;
22c937
  		for (i = 2 + (tp[0] != CSI); i < len
22c937
  				&& !(tp[i] >= '{' && tp[i] <= '~')
22c937
  				&& !ASCII_ISALPHA(tp[i]); ++i)
22c937
  		    if (tp[i] == ';' && ++j == 1)
22c937
+ 		    {
22c937
  			extra = i + 1;
22c937
+ #ifdef FEAT_MBYTE
22c937
+ 			row_char = tp[i - 1];
22c937
+ #endif
22c937
+ 		    }
22c937
  		if (i == len)
22c937
  		{
22c937
  		    LOG_TR("Not enough characters for CRV");
22c937
  		    return -1;
22c937
  		}
22c937
  #ifdef FEAT_MBYTE
22c937
! 		if (extra > 0)
22c937
! 		    col = atoi((char *)tp + extra);
22c937
! 		else
22c937
! 		    col = 0;
22c937
! 
22c937
! 		/* Eat it when it has 2 arguments and ends in 'R'. Also when
22c937
! 		 * u7_status is not "sent", it may be from a previous Vim that
22c937
! 		 * just exited.  But not for <S-F3>, it sends something
22c937
! 		 * similar, check for row and column to make sense. */
22c937
! 		if (j == 1 && tp[i] == 'R' && row_char == '2' && col >= 2)
22c937
  		{
22c937
  		    char *aw = NULL;
22c937
  
22c937
***************
22c937
*** 4211,4228 ****
22c937
  # ifdef FEAT_AUTOCMD
22c937
  		    did_cursorhold = TRUE;
22c937
  # endif
22c937
! 		    if (extra > 0)
22c937
! 			extra = atoi((char *)tp + extra);
22c937
! 		    if (extra == 2)
22c937
  			aw = "single";
22c937
! 		    else if (extra == 3)
22c937
  			aw = "double";
22c937
  		    if (aw != NULL && STRCMP(aw, p_ambw) != 0)
22c937
  		    {
22c937
  			/* Setting the option causes a screen redraw. Do that
22c937
  			 * right away if possible, keeping any messages. */
22c937
  			set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0);
22c937
! #ifdef DEBUG_TERMRESPONSE
22c937
  			{
22c937
  			    char buf[100];
22c937
  			    int  r = redraw_asap(CLEAR);
22c937
--- 4226,4241 ----
22c937
  # ifdef FEAT_AUTOCMD
22c937
  		    did_cursorhold = TRUE;
22c937
  # endif
22c937
! 		    if (col == 2)
22c937
  			aw = "single";
22c937
! 		    else if (col == 3)
22c937
  			aw = "double";
22c937
  		    if (aw != NULL && STRCMP(aw, p_ambw) != 0)
22c937
  		    {
22c937
  			/* Setting the option causes a screen redraw. Do that
22c937
  			 * right away if possible, keeping any messages. */
22c937
  			set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0);
22c937
! # ifdef DEBUG_TERMRESPONSE
22c937
  			{
22c937
  			    char buf[100];
22c937
  			    int  r = redraw_asap(CLEAR);
22c937
***************
22c937
*** 4231,4239 ****
22c937
  									   r);
22c937
  			    log_tr(buf);
22c937
  			}
22c937
! #else
22c937
  			redraw_asap(CLEAR);
22c937
! #endif
22c937
  		    }
22c937
  		    key_name[0] = (int)KS_EXTRA;
22c937
  		    key_name[1] = (int)KE_IGNORE;
22c937
--- 4244,4252 ----
22c937
  									   r);
22c937
  			    log_tr(buf);
22c937
  			}
22c937
! # else
22c937
  			redraw_asap(CLEAR);
22c937
! # endif
22c937
  		    }
22c937
  		    key_name[0] = (int)KS_EXTRA;
22c937
  		    key_name[1] = (int)KE_IGNORE;
22c937
*** ../vim-7.4.206/src/version.c	2014-03-19 12:37:18.537826062 +0100
22c937
--- src/version.c	2014-03-19 12:55:42.249842974 +0100
22c937
***************
22c937
*** 740,741 ****
22c937
--- 740,743 ----
22c937
  {   /* Add new patch number below this line */
22c937
+ /**/
22c937
+     207,
22c937
  /**/
22c937
22c937
-- 
22c937
How come wrong numbers are never busy?
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    ///