Hi Bram and Vim addicts,

The multi-line regexp highlight regression occured from 7.4.405.

How to reproduce #1.
1. Start vim.
  $ vim -N -u NONE

2. Input below.
  :call setline(1, repeat(['abc'], 3))
  :set hlsearch
  /bc\na

Expect behavior:
  1st line:  bc is highlighted.
  2nd line: abc is highlighted.
  3rd line: a   is highlighted.

Actual behavior:
  1st line:  bc is highlighted.
  2nd line: abc is highlighted.
  3rd line:     No character highlighted.  <--- 


How to reproduce #2.
1. Start vim.
  $ vim -N -u NONE

2. Input below.
  :help @en
  :set hlsearch
  /\nClose

Expect behavior:
  6th line: '\n' is highlighted.
  7th line: 'Close' is highlighted. 

Actual behavior:
  6st line: '\n' is  highlighted.
  7nd line: The entire line is highlighted.  <--- 


Investigation result:
  Patch 7.4.405 fixes 7.4.362's performance issue.
  But multi-line regexp highlight regression occured.

  Patch 7.4.362
  https://groups.google.com/d/msg/vim_dev/3PNuYKQ9EAk/ZD9vuxSVHgoJ

  Patch 7.4.405
  https://groups.google.com/d/msg/vim_dev/-n0Id0aFn3s/WHzzHwg28o4J


I attached a patch.
Please check this.

Someone verifying the highlighting by using matchaddpos(), "set hlsearch" and / 
.

Best regards,
Hirohito Higashi (a.k.a h_east)

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
diff -r 4604a182f04c src/screen.c
--- a/src/screen.c	Sun Nov 30 22:51:06 2014 +0100
+++ b/src/screen.c	Sun Dec 07 05:54:58 2014 +0900
@@ -3864,9 +3864,15 @@
 				&& v >= (long)shl->startcol
 				&& v < (long)shl->endcol)
 			{
+#ifdef FEAT_MBYTE
+			    int tmp_col = v + MB_PTR2LEN(ptr);
+
+			    if (shl->endcol < tmp_col)
+				shl->endcol = tmp_col;
+#endif
 			    shl->attr_cur = shl->attr;
 			}
-			else if (v >= (long)shl->endcol && shl->lnum == lnum)
+			else if (v == (long)shl->endcol)
 			{
 			    shl->attr_cur = 0;
 			    next_search_hl(wp, shl, lnum, (colnr_T)v, cur);

Raspunde prin e-mail lui