vim-patch:8.2.1871: using %v in 'errorformat' may fail before %Z

Problem:    Using %v in 'errorformat' may fail before %Z.
Solution:   Set qf_viscol only when qf_col is set. (closes vim/vim#7169)
c95940c06a
This commit is contained in:
Jan Edmund Lazo
2020-10-20 09:31:35 -04:00
parent 77dc891bfb
commit 5621bc66d6
2 changed files with 16 additions and 1 deletions

View File

@@ -1669,8 +1669,8 @@ static int qf_parse_multiline_pfx(int idx, qf_list_T *qfl, qffields_T *fields)
}
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,
*fields->namebuf || qfl->qf_directory

View File

@@ -4064,6 +4064,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')