mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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 #7169)
This commit is contained in:
parent
39ca4127a0
commit
c95940c06a
@ -1362,8 +1362,10 @@ qf_parse_multiline_pfx(
|
|||||||
if (!qfprev->qf_lnum)
|
if (!qfprev->qf_lnum)
|
||||||
qfprev->qf_lnum = fields->lnum;
|
qfprev->qf_lnum = fields->lnum;
|
||||||
if (!qfprev->qf_col)
|
if (!qfprev->qf_col)
|
||||||
|
{
|
||||||
qfprev->qf_col = fields->col;
|
qfprev->qf_col = fields->col;
|
||||||
qfprev->qf_viscol = fields->use_viscol;
|
qfprev->qf_viscol = fields->use_viscol;
|
||||||
|
}
|
||||||
if (!qfprev->qf_fnum)
|
if (!qfprev->qf_fnum)
|
||||||
qfprev->qf_fnum = qf_get_fnum(qfl,
|
qfprev->qf_fnum = qf_get_fnum(qfl,
|
||||||
qfl->qf_directory,
|
qfl->qf_directory,
|
||||||
|
@ -4419,6 +4419,21 @@ func Test_viscol()
|
|||||||
cnext
|
cnext
|
||||||
call assert_equal([16, 25], [col('.'), virtcol('.')])
|
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
|
enew | only
|
||||||
set efm&
|
set efm&
|
||||||
call delete('Xfile1')
|
call delete('Xfile1')
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1871,
|
||||||
/**/
|
/**/
|
||||||
1870,
|
1870,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user