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