diff src/quickfix.c @ 3555:bbf1fbbe4ab4 v7.3.538

updated for version 7.3.538 Problem: 'efm' does not handle Tabs in pointer lines. Solution: Add Tab support. Improve tests. (Lech Lorens)
author Bram Moolenaar <bram@vim.org>
date Fri, 01 Jun 2012 18:34:41 +0200
parents 8101253704f6
children 4f1c511e71f8
line wrap: on
line diff
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -247,7 +247,7 @@ qf_init_ext(qi, efile, buf, tv, errorfor
 			{'t', "."},
 			{'m', ".\\+"},
 			{'r', ".*"},
-			{'p', "[- .]*"},
+			{'p', "[- 	.]*"},
 			{'v', "\\d\\+"},
 			{'s', ".\\+"}
 		    };
@@ -677,11 +677,23 @@ restofline:
 		}
 		if ((i = (int)fmt_ptr->addr[7]) > 0)		/* %p */
 		{
+		    char_u	*match_ptr;
+
 		    if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
 			continue;
-		    col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
-		    if (*((char_u *)regmatch.startp[i]) != TAB)
-			use_viscol = TRUE;
+		    col = 0;
+		    for (match_ptr = regmatch.startp[i];
+				   match_ptr != regmatch.endp[i]; ++match_ptr)
+		    {
+			++col;
+			if (*match_ptr == TAB)
+			{
+			    col += 7;
+			    col -= col % 8;
+			}
+		    }
+		    ++col;
+		    use_viscol = TRUE;
 		}
 		if ((i = (int)fmt_ptr->addr[8]) > 0)		/* %v */
 		{