jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone
Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.4.324
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.324
Problem:    In Ex mode, cyrillic characters are not handled. (Stas Malavin)
Solution:   Support multi-byte characters in Ex mode. (Yukihiro Nakadaira)
Files:	    src/ex_getln.c


*** ../vim-7.4.323/src/ex_getln.c	2014-05-29 14:36:26.156862577 +0200
--- src/ex_getln.c	2014-06-12 19:33:10.440522741 +0200
***************
*** 2188,2193 ****
--- 2188,2194 ----
      int		vcol = 0;
      char_u	*p;
      int		prev_char;
+     int		len;
  
      /* Switch cursor on now.  This avoids that it happens after the "\n", which
       * confuses the system function that computes tabstops. */
***************
*** 2264,2270 ****
  	    {
  		if (line_ga.ga_len > 0)
  		{
! 		    --line_ga.ga_len;
  		    goto redraw;
  		}
  		continue;
--- 2265,2281 ----
  	    {
  		if (line_ga.ga_len > 0)
  		{
! #ifdef FEAT_MBYTE
! 		    if (has_mbyte)
! 		    {
! 			p = (char_u *)line_ga.ga_data;
! 			p[line_ga.ga_len] = NUL;
! 			len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1;
! 			line_ga.ga_len -= len;
! 		    }
! 		    else
! #endif
! 			--line_ga.ga_len;
  		    goto redraw;
  		}
  		continue;
***************
*** 2280,2286 ****
  
  	    if (c1 == Ctrl_T)
  	    {
! 		long        sw = get_sw_value(curbuf);
  
  		p = (char_u *)line_ga.ga_data;
  		p[line_ga.ga_len] = NUL;
--- 2291,2297 ----
  
  	    if (c1 == Ctrl_T)
  	    {
! 		long	    sw = get_sw_value(curbuf);
  
  		p = (char_u *)line_ga.ga_data;
  		p[line_ga.ga_len] = NUL;
***************
*** 2300,2307 ****
  		/* redraw the line */
  		msg_col = startcol;
  		vcol = 0;
! 		for (p = (char_u *)line_ga.ga_data;
! 			  p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p)
  		{
  		    if (*p == TAB)
  		    {
--- 2311,2319 ----
  		/* redraw the line */
  		msg_col = startcol;
  		vcol = 0;
! 		p = (char_u *)line_ga.ga_data;
! 		p[line_ga.ga_len] = NUL;
! 		while (p < (char_u *)line_ga.ga_data + line_ga.ga_len)
  		{
  		    if (*p == TAB)
  		    {
***************
*** 2309,2319 ****
  			{
  			    msg_putchar(' ');
  			} while (++vcol % 8);
  		    }
  		    else
  		    {
! 			msg_outtrans_len(p, 1);
! 			vcol += char2cells(*p);
  		    }
  		}
  		msg_clr_eos();
--- 2321,2334 ----
  			{
  			    msg_putchar(' ');
  			} while (++vcol % 8);
+ 			++p;
  		    }
  		    else
  		    {
! 			len = MB_PTR2LEN(p);
! 			msg_outtrans_len(p, len);
! 			vcol += ptr2cells(p);
! 			p += len;
  		    }
  		}
  		msg_clr_eos();
***************
*** 2362,2368 ****
  
  	if (IS_SPECIAL(c1))
  	    c1 = '?';
! 	((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
  	if (c1 == '\n')
  	    msg_putchar('\n');
  	else if (c1 == TAB)
--- 2377,2392 ----
  
  	if (IS_SPECIAL(c1))
  	    c1 = '?';
! #ifdef FEAT_MBYTE
! 	if (has_mbyte)
! 	    len = (*mb_char2bytes)(c1,
! 				  (char_u *)line_ga.ga_data + line_ga.ga_len);
! 	else
! #endif
! 	{
! 	    len = 1;
! 	    ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
! 	}
  	if (c1 == '\n')
  	    msg_putchar('\n');
  	else if (c1 == TAB)
***************
*** 2376,2385 ****
  	else
  	{
  	    msg_outtrans_len(
! 		     ((char_u *)line_ga.ga_data) + line_ga.ga_len, 1);
  	    vcol += char2cells(c1);
  	}
! 	++line_ga.ga_len;
  	escaped = FALSE;
  
  	windgoto(msg_row, msg_col);
--- 2400,2409 ----
  	else
  	{
  	    msg_outtrans_len(
! 		     ((char_u *)line_ga.ga_data) + line_ga.ga_len, len);
  	    vcol += char2cells(c1);
  	}
! 	line_ga.ga_len += len;
  	escaped = FALSE;
  
  	windgoto(msg_row, msg_col);
*** ../vim-7.4.323/src/version.c	2014-06-12 18:39:16.828400409 +0200
--- src/version.c	2014-06-12 19:37:40.296532950 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     324,
  /**/

-- 
ZOOT:  I'm afraid our life must seem very dull and quiet compared to yours.
       We are but eightscore young blondes, all between sixteen and
       nineteen-and-a-half, cut off in this castle, with no one to protect us.
       Oooh.  It is a lonely life ... bathing ...  dressing ... undressing ...
       making exciting underwear....
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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    ///