d0154f4
To: vim-dev@vim.org
d0154f4
Subject: Patch 7.1.259
d0154f4
Fcc: outbox
d0154f4
From: Bram Moolenaar <Bram@moolenaar.net>
d0154f4
Mime-Version: 1.0
d0154f4
Content-Type: text/plain; charset=ISO-8859-1
d0154f4
Content-Transfer-Encoding: 8bit
d0154f4
------------
d0154f4
d0154f4
Patch 7.1.259
d0154f4
Problem:    Cursor is in the wrong position when 'rightleft' is set,
d0154f4
	    'encoding' is "utf-8" and on an illegal byte.  (Dominique Pelle)
d0154f4
Solution:   Only put the cursor in the first column when actually on a
d0154f4
	    double-wide character.  (Yukihiro Nakadaira)
d0154f4
Files:	    src/screen.c
d0154f4
d0154f4
d0154f4
*** ../vim-7.1.258/src/screen.c	Wed Feb 13 21:48:24 2008
d0154f4
--- src/screen.c	Wed Feb 20 14:06:26 2008
d0154f4
***************
d0154f4
*** 8045,8053 ****
d0154f4
  	windgoto(W_WINROW(curwin) + curwin->w_wrow,
d0154f4
  		W_WINCOL(curwin) + (
d0154f4
  #ifdef FEAT_RIGHTLEFT
d0154f4
  		curwin->w_p_rl ? ((int)W_WIDTH(curwin) - curwin->w_wcol - (
d0154f4
  # ifdef FEAT_MBYTE
d0154f4
! 			has_mbyte ? (*mb_ptr2cells)(ml_get_cursor()) :
d0154f4
  # endif
d0154f4
  			1)) :
d0154f4
  #endif
d0154f4
--- 8045,8057 ----
d0154f4
  	windgoto(W_WINROW(curwin) + curwin->w_wrow,
d0154f4
  		W_WINCOL(curwin) + (
d0154f4
  #ifdef FEAT_RIGHTLEFT
d0154f4
+ 		/* With 'rightleft' set and the cursor on a double-wide
d0154f4
+ 		 * character, position it on the leftmost column. */
d0154f4
  		curwin->w_p_rl ? ((int)W_WIDTH(curwin) - curwin->w_wcol - (
d0154f4
  # ifdef FEAT_MBYTE
d0154f4
! 			(has_mbyte
d0154f4
! 			   && (*mb_ptr2cells)(ml_get_cursor()) == 2
d0154f4
! 			   && vim_isprintc(gchar_cursor())) ? 2 :
d0154f4
  # endif
d0154f4
  			1)) :
d0154f4
  #endif
d0154f4
*** ../vim-7.1.258/src/version.c	Wed Feb 20 13:41:14 2008
d0154f4
--- src/version.c	Wed Feb 20 14:10:23 2008
d0154f4
***************
d0154f4
*** 668,669 ****
d0154f4
--- 668,671 ----
d0154f4
  {   /* Add new patch number below this line */
d0154f4
+ /**/
d0154f4
+     259,
d0154f4
  /**/
d0154f4
d0154f4
-- 
d0154f4
A day without sunshine is like, well, night.
d0154f4
d0154f4
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
d0154f4
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
d0154f4
\\\        download, build and distribute -- http://www.A-A-P.org        ///
d0154f4
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///