From 8b668fb0ec1eff810998c810de5374a1635183c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Sun, 28 Apr 2024 15:15:35 +0200 Subject: [PATCH] fix(qf): adjust handler for missing character refer: #2943 --- autoload/vimtex/qf/latexlog.vim | 4 +++- test/example-quickfix/main.log | 7 ++----- test/test-quickfix/test-latexlog.vim | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/autoload/vimtex/qf/latexlog.vim b/autoload/vimtex/qf/latexlog.vim index 9289e024dc..44dd26103e 100644 --- a/autoload/vimtex/qf/latexlog.vim +++ b/autoload/vimtex/qf/latexlog.vim @@ -36,9 +36,9 @@ function! s:qf.set_errorformat() abort dict "{{{1 setlocal errorformat+=%E!\ LaTeX\ %trror:\ %m setlocal errorformat+=%E%f:%l:\ %m setlocal errorformat+=%+ERunaway\ argument? + setlocal errorformat+=%-G{/%m setlocal errorformat+=%+C{%m setlocal errorformat+=%C!\ %m - setlocal errorformat+=%EMissing\ character:\ %m " More info for undefined control sequences setlocal errorformat+=%Z\ %m @@ -63,6 +63,8 @@ function! s:qf.set_errorformat() abort dict "{{{1 setlocal errorformat+=%+WUnderfull\ %\\%\\hbox%.%#\ at\ lines\ %l--%*\\d setlocal errorformat+=%+WUnderfull\ %\\%\\vbox%.%#\ at\ line\ %l + setlocal errorformat+=%+WMissing\ character:\ %m + " " Define package related warnings " diff --git a/test/example-quickfix/main.log b/test/example-quickfix/main.log index b4fd7353d2..484ed35511 100644 --- a/test/example-quickfix/main.log +++ b/test/example-quickfix/main.log @@ -52,11 +52,8 @@ control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best. Missing character: There is no ^^A (U+0001) in font [lmroman10-regular]:+tlig;! -. - ...not:N \tex_shipout:D \box_use:N \l_shipout_box - \__shipout_drop_firstpage_... -l.9 \end{document} - +{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux) + ./test.tex:11: Undefined control sequence. l.11 \cdashline {1-7} diff --git a/test/test-quickfix/test-latexlog.vim b/test/test-quickfix/test-latexlog.vim index a1848341cc..ad83348227 100644 --- a/test/test-quickfix/test-latexlog.vim +++ b/test/test-quickfix/test-latexlog.vim @@ -30,7 +30,7 @@ for s:expect in [ \ {'lnum': 0, 'type': 'E', 'text': "Runaway argument?\n{\\sqrt {{1}} \\end {equation} \\par \\end {document} \nFile ended while scanning use of \\frac ."}, \ {'lnum': 0, 'type': 'E', 'text': 'Runaway argument?'}, \ {'lnum': 16, 'type': 'E', 'text': 'Paragraph ended before \date was complete.'}, - \ {'lnum': 0, 'type': 'E', 'text': 'There is no ^^A (U+0001) in font [lmroman10-regular]:+tlig;!'}, + \ {'lnum': 0, 'type': 'W', 'text': 'Missing character: There is no ^^A (U+0001) in font [lmroman10-regular]:+tlig;!'}, \ {'lnum': 11, 'type': 'E', 'text': "Undefined control sequence.\n\\cdashline"}, \] call assert_equal(s:expect.lnum, s:qf[s:n].lnum, 'Failed at index ' . s:n)