summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-20 14:59:12 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-20 14:59:12 +0200
commitc95940c06a125d3afe6516f11f8b2f5697a6b3b9 (patch)
tree9c4e51705ca89f87c81fb13d3885d274632d9506
parent39ca4127a094d8aca6f77c01be4f3fea506d5cb7 (diff)
downloadvim-git-c95940c06a125d3afe6516f11f8b2f5697a6b3b9.tar.gz
patch 8.2.1871: using %v in 'errorformat' may fail before %Zv8.2.1871
Problem: Using %v in 'errorformat' may fail before %Z. Solution: Set qf_viscol only when qf_col is set. (closes #7169)
-rw-r--r--src/quickfix.c4
-rw-r--r--src/testdir/test_quickfix.vim15
-rw-r--r--src/version.c2
3 files changed, 20 insertions, 1 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index d50cd16a1..5e0d3c352 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -1362,8 +1362,10 @@ qf_parse_multiline_pfx(
if (!qfprev->qf_lnum)
qfprev->qf_lnum = fields->lnum;
if (!qfprev->qf_col)
+ {
qfprev->qf_col = fields->col;
- qfprev->qf_viscol = fields->use_viscol;
+ qfprev->qf_viscol = fields->use_viscol;
+ }
if (!qfprev->qf_fnum)
qfprev->qf_fnum = qf_get_fnum(qfl,
qfl->qf_directory,
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index 332831aa4..88eabaa04 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -4419,6 +4419,21 @@ func Test_viscol()
cnext
call assert_equal([16, 25], [col('.'), virtcol('.')])
+ " Use screen column number with a multi-line error message
+ enew
+ call writefile(["à test"], 'Xfile1')
+ set efm=%E===\ %f\ ===,%C%l:%v,%Z%m
+ cexpr ["=== Xfile1 ===", "1:3", "errormsg"]
+ call assert_equal('Xfile1', @%)
+ call assert_equal([0, 1, 4, 0], getpos('.'))
+
+ " Repeat previous test with byte offset %c: ensure that fix to issue #7145
+ " does not break this
+ set efm=%E===\ %f\ ===,%C%l:%c,%Z%m
+ cexpr ["=== Xfile1 ===", "1:3", "errormsg"]
+ call assert_equal('Xfile1', @%)
+ call assert_equal([0, 1, 3, 0], getpos('.'))
+
enew | only
set efm&
call delete('Xfile1')
diff --git a/src/version.c b/src/version.c
index 835de6c5b..48f7273e1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1871,
+/**/
1870,
/**/
1869,