Karsten Hopp 230110
To: vim_dev@googlegroups.com
Karsten Hopp 230110
Subject: Patch 7.3.695
Karsten Hopp 230110
Fcc: outbox
Karsten Hopp 230110
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 230110
Mime-Version: 1.0
Karsten Hopp 230110
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 230110
Content-Transfer-Encoding: 8bit
Karsten Hopp 230110
------------
Karsten Hopp 230110
Karsten Hopp 230110
Patch 7.3.695
Karsten Hopp 230110
Problem:    Balloon cannot show multi-byte text.
Karsten Hopp 230110
Solution:   Properly deal with multi-byte characters. (Dominique Pelle)
Karsten Hopp 230110
Files:      src/gui_beval.c, src/ui.c
Karsten Hopp 230110
Karsten Hopp 230110
Karsten Hopp 230110
*** ../vim-7.3.694/src/gui_beval.c	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp 230110
--- src/gui_beval.c	2012-10-21 00:54:19.000000000 +0200
Karsten Hopp 230110
***************
Karsten Hopp 230110
*** 359,365 ****
Karsten Hopp 230110
  			}
Karsten Hopp 230110
  		    }
Karsten Hopp 230110
  
Karsten Hopp 230110
! 		    col = vcol2col(wp, lnum, col) - 1;
Karsten Hopp 230110
  
Karsten Hopp 230110
  		    if (VIsual_active
Karsten Hopp 230110
  			    && wp->w_buffer == curwin->w_buffer
Karsten Hopp 230110
--- 359,365 ----
Karsten Hopp 230110
  			}
Karsten Hopp 230110
  		    }
Karsten Hopp 230110
  
Karsten Hopp 230110
! 		    col = vcol2col(wp, lnum, col);
Karsten Hopp 230110
  
Karsten Hopp 230110
  		    if (VIsual_active
Karsten Hopp 230110
  			    && wp->w_buffer == curwin->w_buffer
Karsten Hopp 230110
***************
Karsten Hopp 230110
*** 377,384 ****
Karsten Hopp 230110
  			    return FAIL;
Karsten Hopp 230110
  
Karsten Hopp 230110
  			lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE);
Karsten Hopp 230110
! 			lbuf = vim_strnsave(lbuf + spos->col,
Karsten Hopp 230110
! 				     epos->col - spos->col + (*p_sel != 'e'));
Karsten Hopp 230110
  			lnum = spos->lnum;
Karsten Hopp 230110
  			col = spos->col;
Karsten Hopp 230110
  		    }
Karsten Hopp 230110
--- 377,386 ----
Karsten Hopp 230110
  			    return FAIL;
Karsten Hopp 230110
  
Karsten Hopp 230110
  			lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE);
Karsten Hopp 230110
! 			len = epos->col - spos->col;
Karsten Hopp 230110
! 			if (*p_sel != 'e')
Karsten Hopp 230110
! 			    len += MB_PTR2LEN(lbuf + epos->col);
Karsten Hopp 230110
! 			lbuf = vim_strnsave(lbuf + spos->col, len);
Karsten Hopp 230110
  			lnum = spos->lnum;
Karsten Hopp 230110
  			col = spos->col;
Karsten Hopp 230110
  		    }
Karsten Hopp 230110
*** ../vim-7.3.694/src/ui.c	2012-08-29 16:26:01.000000000 +0200
Karsten Hopp 230110
--- src/ui.c	2012-10-21 00:50:17.000000000 +0200
Karsten Hopp 230110
***************
Karsten Hopp 230110
*** 98,104 ****
Karsten Hopp 230110
  #endif
Karsten Hopp 230110
  
Karsten Hopp 230110
  /*
Karsten Hopp 230110
!  * ui_inchar(): low level input funcion.
Karsten Hopp 230110
   * Get characters from the keyboard.
Karsten Hopp 230110
   * Return the number of characters that are available.
Karsten Hopp 230110
   * If "wtime" == 0 do not wait for characters.
Karsten Hopp 230110
--- 98,104 ----
Karsten Hopp 230110
  #endif
Karsten Hopp 230110
  
Karsten Hopp 230110
  /*
Karsten Hopp 230110
!  * ui_inchar(): low level input function.
Karsten Hopp 230110
   * Get characters from the keyboard.
Karsten Hopp 230110
   * Return the number of characters that are available.
Karsten Hopp 230110
   * If "wtime" == 0 do not wait for characters.
Karsten Hopp 230110
***************
Karsten Hopp 230110
*** 493,499 ****
Karsten Hopp 230110
  	}
Karsten Hopp 230110
      }
Karsten Hopp 230110
  #else
Karsten Hopp 230110
!     /* Only own the clibpard when we didn't own it yet. */
Karsten Hopp 230110
      if (!cbd->owned && cbd->available)
Karsten Hopp 230110
  	cbd->owned = (clip_gen_own_selection(cbd) == OK);
Karsten Hopp 230110
  #endif
Karsten Hopp 230110
--- 493,499 ----
Karsten Hopp 230110
  	}
Karsten Hopp 230110
      }
Karsten Hopp 230110
  #else
Karsten Hopp 230110
!     /* Only own the clipboard when we didn't own it yet. */
Karsten Hopp 230110
      if (!cbd->owned && cbd->available)
Karsten Hopp 230110
  	cbd->owned = (clip_gen_own_selection(cbd) == OK);
Karsten Hopp 230110
  #endif
Karsten Hopp 230110
***************
Karsten Hopp 230110
*** 3132,3138 ****
Karsten Hopp 230110
      char_u	*start;
Karsten Hopp 230110
  
Karsten Hopp 230110
      start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
Karsten Hopp 230110
!     while (count <= vcol && *ptr != NUL)
Karsten Hopp 230110
      {
Karsten Hopp 230110
  	count += win_lbr_chartabsize(wp, ptr, count, NULL);
Karsten Hopp 230110
  	mb_ptr_adv(ptr);
Karsten Hopp 230110
--- 3132,3138 ----
Karsten Hopp 230110
      char_u	*start;
Karsten Hopp 230110
  
Karsten Hopp 230110
      start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
Karsten Hopp 230110
!     while (count < vcol && *ptr != NUL)
Karsten Hopp 230110
      {
Karsten Hopp 230110
  	count += win_lbr_chartabsize(wp, ptr, count, NULL);
Karsten Hopp 230110
  	mb_ptr_adv(ptr);
Karsten Hopp 230110
*** ../vim-7.3.694/src/version.c	2012-10-21 00:44:59.000000000 +0200
Karsten Hopp 230110
--- src/version.c	2012-10-21 00:50:32.000000000 +0200
Karsten Hopp 230110
***************
Karsten Hopp 230110
*** 721,722 ****
Karsten Hopp 230110
--- 721,724 ----
Karsten Hopp 230110
  {   /* Add new patch number below this line */
Karsten Hopp 230110
+ /**/
Karsten Hopp 230110
+     695,
Karsten Hopp 230110
  /**/
Karsten Hopp 230110
Karsten Hopp 230110
-- 
Karsten Hopp 230110
BEDEVERE:        Why do you think she is a witch?
Karsten Hopp 230110
SECOND VILLAGER: She turned me into a newt.
Karsten Hopp 230110
BEDEVERE:        A newt?
Karsten Hopp 230110
SECOND VILLAGER: (After looking at himself for some time) I got better.
Karsten Hopp 230110
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 230110
Karsten Hopp 230110
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 230110
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 230110
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 230110
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///