Skip to content

Incoherent error log when using input #2256

@sgorblex

Description

@sgorblex

Description

In a project with \input{file}, errors are correctly reported in the errors window with the correct file and line number, whereas warnings report the name of the main file (I'm not sure about the line number). This also effects jumping when typing <CR> on said warning.

Steps to reproduce

I've tried this on both my Arch machines with Neovim and on a fresh Ubuntu docker with Vim (I'll use the latter example as it's simpler).

~/.vimrc:

set nocompatible
set encoding=utf-8

call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
call plug#end()

(only vim-plug and vimtex installed)

The example project has the following two files:
main.tex:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
Lorem ipsum dolor sit amet,
\input{sourceme}
\end{document}

sourceme.tex:

consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\begin{equation}
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
\end{equation}

Open one of the two .tex and type <leader>cc.

Expected behavior

In the error window:

sourceme.tex|4 warning| Overfull \hbox (130.72998pt too wide) detected at line 4

(and correct jumping)

Actual behavior

main.tex|4 warning| Overfull \hbox (130.72998pt too wide) detected at line 4

(and wrong jumping)

Do you use a latexmkrc file?

No

VimtexInfo

System info
  OS: Linux 5.15.4-arch1-1
  Vim version: VIM 8.1 (1-2269)
  Has clientserver: false

VimTeX project: main
  base: main.tex
  root: /root/project
  tex: /root/project/main.tex
  main parser: current file verified
  document class: article
  packages: amsbsy amsgen amsmath amsopn amstext
  source files:
    main.tex
    sourceme.tex
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job:
      jobid: process 7912 run
      output: /tmp/v7ahdMp/0
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -e '$pdf_previewer = "xdg-open"' -e '$compiling_cmd = ($compiling_cmd ? $compiling_cmd . " ; " : "") . "echo vimtex_compiler_callback_compiling"' -e '$success_cmd = ($success_cmd ? $success_cmd . " ; " : "") . "echo vimtex_compiler_callback_success"' -e '$failure_cmd = ($failure_cmd ? $failure_cmd . " ; " : "") . "echo vimtex_compiler_callback_failure"' 'main.tex'
      pid: 7912
  viewer: General
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions