jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone
3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.324
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.324
3ef2ca
Problem:    In Ex mode, cyrillic characters are not handled. (Stas Malavin)
3ef2ca
Solution:   Support multi-byte characters in Ex mode. (Yukihiro Nakadaira)
3ef2ca
Files:	    src/ex_getln.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.323/src/ex_getln.c	2014-05-29 14:36:26.156862577 +0200
3ef2ca
--- src/ex_getln.c	2014-06-12 19:33:10.440522741 +0200
3ef2ca
***************
3ef2ca
*** 2188,2193 ****
3ef2ca
--- 2188,2194 ----
3ef2ca
      int		vcol = 0;
3ef2ca
      char_u	*p;
3ef2ca
      int		prev_char;
3ef2ca
+     int		len;
3ef2ca
  
3ef2ca
      /* Switch cursor on now.  This avoids that it happens after the "\n", which
3ef2ca
       * confuses the system function that computes tabstops. */
3ef2ca
***************
3ef2ca
*** 2264,2270 ****
3ef2ca
  	    {
3ef2ca
  		if (line_ga.ga_len > 0)
3ef2ca
  		{
3ef2ca
! 		    --line_ga.ga_len;
3ef2ca
  		    goto redraw;
3ef2ca
  		}
3ef2ca
  		continue;
3ef2ca
--- 2265,2281 ----
3ef2ca
  	    {
3ef2ca
  		if (line_ga.ga_len > 0)
3ef2ca
  		{
3ef2ca
! #ifdef FEAT_MBYTE
3ef2ca
! 		    if (has_mbyte)
3ef2ca
! 		    {
3ef2ca
! 			p = (char_u *)line_ga.ga_data;
3ef2ca
! 			p[line_ga.ga_len] = NUL;
3ef2ca
! 			len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1;
3ef2ca
! 			line_ga.ga_len -= len;
3ef2ca
! 		    }
3ef2ca
! 		    else
3ef2ca
! #endif
3ef2ca
! 			--line_ga.ga_len;
3ef2ca
  		    goto redraw;
3ef2ca
  		}
3ef2ca
  		continue;
3ef2ca
***************
3ef2ca
*** 2280,2286 ****
3ef2ca
  
3ef2ca
  	    if (c1 == Ctrl_T)
3ef2ca
  	    {
3ef2ca
! 		long        sw = get_sw_value(curbuf);
3ef2ca
  
3ef2ca
  		p = (char_u *)line_ga.ga_data;
3ef2ca
  		p[line_ga.ga_len] = NUL;
3ef2ca
--- 2291,2297 ----
3ef2ca
  
3ef2ca
  	    if (c1 == Ctrl_T)
3ef2ca
  	    {
3ef2ca
! 		long	    sw = get_sw_value(curbuf);
3ef2ca
  
3ef2ca
  		p = (char_u *)line_ga.ga_data;
3ef2ca
  		p[line_ga.ga_len] = NUL;
3ef2ca
***************
3ef2ca
*** 2300,2307 ****
3ef2ca
  		/* redraw the line */
3ef2ca
  		msg_col = startcol;
3ef2ca
  		vcol = 0;
3ef2ca
! 		for (p = (char_u *)line_ga.ga_data;
3ef2ca
! 			  p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p)
3ef2ca
  		{
3ef2ca
  		    if (*p == TAB)
3ef2ca
  		    {
3ef2ca
--- 2311,2319 ----
3ef2ca
  		/* redraw the line */
3ef2ca
  		msg_col = startcol;
3ef2ca
  		vcol = 0;
3ef2ca
! 		p = (char_u *)line_ga.ga_data;
3ef2ca
! 		p[line_ga.ga_len] = NUL;
3ef2ca
! 		while (p < (char_u *)line_ga.ga_data + line_ga.ga_len)
3ef2ca
  		{
3ef2ca
  		    if (*p == TAB)
3ef2ca
  		    {
3ef2ca
***************
3ef2ca
*** 2309,2319 ****
3ef2ca
  			{
3ef2ca
  			    msg_putchar(' ');
3ef2ca
  			} while (++vcol % 8);
3ef2ca
  		    }
3ef2ca
  		    else
3ef2ca
  		    {
3ef2ca
! 			msg_outtrans_len(p, 1);
3ef2ca
! 			vcol += char2cells(*p);
3ef2ca
  		    }
3ef2ca
  		}
3ef2ca
  		msg_clr_eos();
3ef2ca
--- 2321,2334 ----
3ef2ca
  			{
3ef2ca
  			    msg_putchar(' ');
3ef2ca
  			} while (++vcol % 8);
3ef2ca
+ 			++p;
3ef2ca
  		    }
3ef2ca
  		    else
3ef2ca
  		    {
3ef2ca
! 			len = MB_PTR2LEN(p);
3ef2ca
! 			msg_outtrans_len(p, len);
3ef2ca
! 			vcol += ptr2cells(p);
3ef2ca
! 			p += len;
3ef2ca
  		    }
3ef2ca
  		}
3ef2ca
  		msg_clr_eos();
3ef2ca
***************
3ef2ca
*** 2362,2368 ****
3ef2ca
  
3ef2ca
  	if (IS_SPECIAL(c1))
3ef2ca
  	    c1 = '?';
3ef2ca
! 	((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
3ef2ca
  	if (c1 == '\n')
3ef2ca
  	    msg_putchar('\n');
3ef2ca
  	else if (c1 == TAB)
3ef2ca
--- 2377,2392 ----
3ef2ca
  
3ef2ca
  	if (IS_SPECIAL(c1))
3ef2ca
  	    c1 = '?';
3ef2ca
! #ifdef FEAT_MBYTE
3ef2ca
! 	if (has_mbyte)
3ef2ca
! 	    len = (*mb_char2bytes)(c1,
3ef2ca
! 				  (char_u *)line_ga.ga_data + line_ga.ga_len);
3ef2ca
! 	else
3ef2ca
! #endif
3ef2ca
! 	{
3ef2ca
! 	    len = 1;
3ef2ca
! 	    ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
3ef2ca
! 	}
3ef2ca
  	if (c1 == '\n')
3ef2ca
  	    msg_putchar('\n');
3ef2ca
  	else if (c1 == TAB)
3ef2ca
***************
3ef2ca
*** 2376,2385 ****
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    msg_outtrans_len(
3ef2ca
! 		     ((char_u *)line_ga.ga_data) + line_ga.ga_len, 1);
3ef2ca
  	    vcol += char2cells(c1);
3ef2ca
  	}
3ef2ca
! 	++line_ga.ga_len;
3ef2ca
  	escaped = FALSE;
3ef2ca
  
3ef2ca
  	windgoto(msg_row, msg_col);
3ef2ca
--- 2400,2409 ----
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    msg_outtrans_len(
3ef2ca
! 		     ((char_u *)line_ga.ga_data) + line_ga.ga_len, len);
3ef2ca
  	    vcol += char2cells(c1);
3ef2ca
  	}
3ef2ca
! 	line_ga.ga_len += len;
3ef2ca
  	escaped = FALSE;
3ef2ca
  
3ef2ca
  	windgoto(msg_row, msg_col);
3ef2ca
*** ../vim-7.4.323/src/version.c	2014-06-12 18:39:16.828400409 +0200
3ef2ca
--- src/version.c	2014-06-12 19:37:40.296532950 +0200
3ef2ca
***************
3ef2ca
*** 736,737 ****
3ef2ca
--- 736,739 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     324,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
ZOOT:  I'm afraid our life must seem very dull and quiet compared to yours.
3ef2ca
       We are but eightscore young blondes, all between sixteen and
3ef2ca
       nineteen-and-a-half, cut off in this castle, with no one to protect us.
3ef2ca
       Oooh.  It is a lonely life ... bathing ...  dressing ... undressing ...
3ef2ca
       making exciting underwear....
3ef2ca
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///