diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-20 09:31:35 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-20 18:03:14 -0400 |
commit | 5621bc66d64791a8ed78aade45f1c89ae9ddcb98 (patch) | |
tree | ee314f9bd36674986a5eb5204ab3ac2ad6e3a207 | |
parent | 77dc891bfbdcdb84f919f6ff5b535b385c121007 (diff) | |
download | rneovim-5621bc66d64791a8ed78aade45f1c89ae9ddcb98.tar.gz rneovim-5621bc66d64791a8ed78aade45f1c89ae9ddcb98.tar.bz2 rneovim-5621bc66d64791a8ed78aade45f1c89ae9ddcb98.zip |
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)
https://github.com/vim/vim/commit/c95940c06a125d3afe6516f11f8b2f5697a6b3b9
-rw-r--r-- | src/nvim/quickfix.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 4d3d0f5fdf..2778179691 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -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 diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index d46233991c..0e6cf39b49 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -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') |