2102f06
To: vim-dev@vim.org
2102f06
Subject: Patch 7.2.258
2102f06
Fcc: outbox
2102f06
From: Bram Moolenaar <Bram@moolenaar.net>
2102f06
Mime-Version: 1.0
2102f06
Content-Type: text/plain; charset=UTF-8
2102f06
Content-Transfer-Encoding: 8bit
2102f06
------------
2102f06
2102f06
Patch 7.2.258
2102f06
Problem:    v:beval_col and b:beval_text are wrong in UTF-8 text. (Tony
2102f06
	    Mechelynck)
2102f06
Solution:   Use byte number instead of character number for the column.
2102f06
Files:	    src/ui.c
2102f06
2102f06
2102f06
*** ../vim-7.2.257/src/ui.c	2009-07-01 18:04:30.000000000 +0200
2102f06
--- src/ui.c	2009-09-11 16:11:50.000000000 +0200
2102f06
***************
2102f06
*** 3055,3072 ****
2102f06
      int		vcol;
2102f06
  {
2102f06
      /* try to advance to the specified column */
2102f06
-     int		col = 0;
2102f06
      int		count = 0;
2102f06
      char_u	*ptr;
2102f06
  
2102f06
!     ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
2102f06
      while (count <= vcol && *ptr != NUL)
2102f06
      {
2102f06
- 	++col;
2102f06
  	count += win_lbr_chartabsize(wp, ptr, count, NULL);
2102f06
  	mb_ptr_adv(ptr);
2102f06
      }
2102f06
!     return col;
2102f06
  }
2102f06
  #endif
2102f06
  
2102f06
--- 3055,3071 ----
2102f06
      int		vcol;
2102f06
  {
2102f06
      /* try to advance to the specified column */
2102f06
      int		count = 0;
2102f06
      char_u	*ptr;
2102f06
+     char_u	*start;
2102f06
  
2102f06
!     start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
2102f06
      while (count <= vcol && *ptr != NUL)
2102f06
      {
2102f06
  	count += win_lbr_chartabsize(wp, ptr, count, NULL);
2102f06
  	mb_ptr_adv(ptr);
2102f06
      }
2102f06
!     return (int)(ptr - start);
2102f06
  }
2102f06
  #endif
2102f06
  
2102f06
*** ../vim-7.2.257/src/version.c	2009-09-11 16:17:36.000000000 +0200
2102f06
--- src/version.c	2009-09-11 16:45:48.000000000 +0200
2102f06
***************
2102f06
*** 678,679 ****
2102f06
--- 678,681 ----
2102f06
  {   /* Add new patch number below this line */
2102f06
+ /**/
2102f06
+     258,
2102f06
  /**/
2102f06
2102f06
-- 
2102f06
hundred-and-one symptoms of being an internet addict:
2102f06
232. You start conversations with, "Have you gotten an ISDN line?"
2102f06
2102f06
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
2102f06
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
2102f06
\\\        download, build and distribute -- http://www.A-A-P.org        ///
2102f06
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///