Hi Yukihiro ,Christian and Bram

2014/8/16(Sat) 10:14:35 UTC+9 Yukihiro Nakadaira:
> It doesn't work when highlighting multiple characters.
> 
> $ vim -u NONE
> :set encoding=utf-8
> :call setline(1, 'aaaaa')
> :hi Test guibg=red ctermbg=red
> 
> :call matchaddpos('Test', [[1, 1, 2]]) 

Thanks for bug report!

I update a patch. (Attached)


2014/8/16(Sat) 21:57:23 UTC+9 Christian Brabandt:
> Can you all please check, if all your issues also occur with the patch
> 
> from here:
> 
> https://groups.google.com/forum/#!msg/vim_use/V6cRWX4c13E/qh3YCUESU0kJ

Thanks for report.
I will check them soon in my new patch.

--
Best regards,
Hirohito Higashi

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff -r 18fd959b07ef src/screen.c
--- a/src/screen.c	Wed Aug 13 22:05:54 2014 +0200
+++ b/src/screen.c	Sat Aug 16 20:13:23 2014 +0900
@@ -2911,6 +2911,7 @@
     int		mb_c = 0;		/* decoded multi-byte character */
     int		mb_utf8 = FALSE;	/* screen char is UTF-8 char */
     int		u8cc[MAX_MCO];		/* composing UTF-8 chars */
+    int		hl_len = 0;
 #endif
 #ifdef FEAT_DIFF
     int		filler_lines;		/* nr of filler lines to be drawn */
@@ -3832,6 +3833,10 @@
 		 * priority).
 		 */
 		v = (long)(ptr - line);
+#ifdef FEAT_MBYTE
+		if (has_mbyte)
+		    hl_len += (*mb_ptr2len)(ptr);
+#endif
 		cur = wp->w_match_head;
 		shl_flag = FALSE;
 		while (cur != NULL || shl_flag == FALSE)
@@ -3857,10 +3862,17 @@
 				&& v < (long)shl->endcol)
 			{
 			    shl->attr_cur = shl->attr;
+#ifdef FEAT_MBYTE
+			    if (has_mbyte && shl->endcol < hl_len)
+				shl->endcol = hl_len;
+#endif
 			}
-			else if (v >= (long)shl->endcol)
+			else if (v == (long)shl->endcol)
 			{
 			    shl->attr_cur = 0;
+#ifdef FEAT_MBYTE
+			    hl_len = 0;
+#endif
 			    next_search_hl(wp, shl, lnum, (colnr_T)v, cur);
 			    pos_inprogress = cur == NULL || cur->pos.cur == 0
 							      ? FALSE : TRUE;

Reply via email to