To: vim_dev@googlegroups.com Subject: Patch 8.2.1871 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1871 Problem: Using %v in 'errorformat' may fail before %Z. Solution: Set qf_viscol only when qf_col is set. (closes #7169) Files: src/quickfix.c, src/testdir/test_quickfix.vim *** ../vim-8.2.1870/src/quickfix.c 2020-09-29 22:46:59.951728644 +0200 --- src/quickfix.c 2020-10-20 14:56:32.141494883 +0200 *************** *** 1362,1369 **** if (!qfprev->qf_lnum) qfprev->qf_lnum = fields->lnum; if (!qfprev->qf_col) qfprev->qf_col = fields->col; ! qfprev->qf_viscol = fields->use_viscol; if (!qfprev->qf_fnum) qfprev->qf_fnum = qf_get_fnum(qfl, qfl->qf_directory, --- 1362,1371 ---- if (!qfprev->qf_lnum) qfprev->qf_lnum = fields->lnum; if (!qfprev->qf_col) + { qfprev->qf_col = fields->col; ! qfprev->qf_viscol = fields->use_viscol; ! } if (!qfprev->qf_fnum) qfprev->qf_fnum = qf_get_fnum(qfl, qfl->qf_directory, *** ../vim-8.2.1870/src/testdir/test_quickfix.vim 2020-09-29 22:46:59.951728644 +0200 --- src/testdir/test_quickfix.vim 2020-10-20 14:56:32.141494883 +0200 *************** *** 4419,4424 **** --- 4419,4439 ---- 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') *** ../vim-8.2.1870/src/version.c 2020-10-20 14:25:03.930883006 +0200 --- src/version.c 2020-10-20 14:56:23.885514978 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1871, /**/ -- From "know your smileys": :-E Has major dental problems /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///