Skip to content

Commit

Permalink
feat(qf): parse the emergency stop signal
Browse files Browse the repository at this point in the history
refer: #3086
  • Loading branch information
lervag committed Jan 26, 2025
1 parent b4eb436 commit 83e331d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions autoload/vimtex/qf/latexlog.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function! s:qf.set_errorformat() abort dict "{{{1
setlocal errorformat+=%-P**\"%f\"

" Match errors
setlocal errorformat+=%+E!\ Emergency\ stop.
setlocal errorformat+=%E!\ LaTeX\ %trror:\ %m
setlocal errorformat+=%E!pdfTeX\ error:\ %m
setlocal errorformat+=%E%f:%l:\ \ ==>\ %m
Expand Down Expand Up @@ -134,6 +135,10 @@ function! s:qf.fix_paths(log) abort dict " {{{1
let l:qf.text = substitute(l:qf.text, '\s*on input line \d\+.$', '', '')
endif

if l:qf.text ==# '! Emergency stop.'
let l:qf.text = 'Emergency stop (fatal error)!'
endif

" Handle missing buffer/filename: Fallback to the main file (this is always
" correct in single-file projects and is thus a good fallback).
if l:qf.bufnr == 0
Expand Down
1 change: 1 addition & 0 deletions test/test-quickfix/test-latexlog.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endtry

let s:expected_list = [
\ {'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': "Emergency stop (fatal error)!"},
\ {'lnum': 0, 'type': 'E', 'text': 'Runaway argument?'},
\ {'lnum': 16, 'type': 'E', 'text': 'Paragraph ended before \date was complete.'},
\ {'lnum': 11, 'type': 'E', 'text': "Undefined control sequence.\n\\cdashline"},
Expand Down

0 comments on commit 83e331d

Please sign in to comment.