Skip to content

Compilation resulting in many warnings causes long computations which block vim #2407

@danielrainer

Description

@danielrainer

Description

When compiling a table which results in a lot of overfull hbox warnings, vimtex functions are executed for a long time which blocks the editor.

Steps to reproduce

minimal.tex
minimal.vim
(Github does not seem to allow uploading files with .tex or .vim extensions, so in the upload the files have an additional .txt extension.)

The only deviation from the default vim/nvim config is having vimtex installed. The example config does this with vim-plug.

  1. nvim -u minimal.vim minimal.tex
  2. :VimtexCompile
  3. Compilation finishes quickly, but vimtex continues executing for a long time before finally the warnings are shown. In the meantime the editor is unusable.

To get a profile of the offending functions:

  1. nvim -u minimal.vim minimal.tex
  2. :profile start ~/profile.log
  3. :profile func *
  4. :profile file *
  5. :VimtexCompile
  6. :profile pause
  7. :qa
  8. less ~/profile.log
  9. /Total time: \+[1-9]

On my system, several functions there run for more than a minute.
profile.log

Expected behavior

I expect the warnings to be shown within a sub-second time after compilation is done.

Actual behavior

It takes more than a minute to show the warnings.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Linux 5.18.1-arch1-1
  Vim version: NVIM v0.5.1
  Has clientserver: true
  Servername: /tmp/nvimEbNokd/0
        
VimTeX project: repro
  base: repro.tex
  root: /root
  tex: /root/repro.tex
  main parser: current file verified
  document class: article
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 5
      output: /tmp/nvimEbNokd/1
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode
      pid: 10          
  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