mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
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:
@@ -1669,8 +1669,8 @@ static int qf_parse_multiline_pfx(int idx, qf_list_T *qfl, qffields_T *fields)
|
|||||||
}
|
}
|
||||||
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, qfl->qf_directory,
|
qfprev->qf_fnum = qf_get_fnum(qfl, qfl->qf_directory,
|
||||||
*fields->namebuf || qfl->qf_directory
|
*fields->namebuf || qfl->qf_directory
|
||||||
|
@@ -4064,6 +4064,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')
|
||||||
|
Reference in New Issue
Block a user