Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim(let):E684: list index out of range: 1 for missing comma in bibliography #2663

Closed
Svalorzen opened this issue Mar 8, 2023 · 3 comments
Closed
Labels

Comments

@Svalorzen
Copy link

Svalorzen commented Mar 8, 2023

Description

In the middle of a bunch of updates to my latex project I suddenly started receiving the error Vim(let):E684: list index out of range: 1, with no explanation or cause to it.

I started debugging it, and after a very long time, I traced it to a missing comma inside one of my bibliography entries. I'm not sure whether the ergonomics of such an issue can be improved, but I thought of reporting this anyway.

Relevant last part of log when running with vim -V9:

49   if b:vimtex.compiler.silence_next_callback
50     call vimtex#log#set_silent_restore()
51     let b:vimtex.compiler.silence_next_callback = 0
52   endif
53  
54   call vimtex#qf#open(0)
55   silent! call s:output.resume()
   endfunction
  1: /usr/share/vim/vimrc
  2: /usr/share/vim/vim90/debian.vim
  3: /usr/share/vim/vim90/syntax/syntax.vim
  ...
181: ~/.vim/bundle/vimtex/autoload/vimtex/jobs/vim.vim
182: ~/.vim/bundle/vimtex/autoload/vimtex/qf/u.vim
183: ~/.vim/bundle/vimtex/autoload/vimtex/qf/biblatex.vim
VimTeX: Something went wrong when parsing log files!
        Vim(let):E684: List index out of range: 1
Error detected while processing function <SNR>111_callback_continuous_output[6]..<SNR>111_check_callback[4]..vimtex#compiler#callback:
line   55:
E121: Undefined variable: s:output

Steps to reproduce

vimtex config:

let g:vimtex_enabled=1
" We use latex for tex
let g:tex_flavor = 'latex'
let g:vimtex_compiler_latexmk = {
    \ 'build_dir' : 'build'
\}

main.tex:

\documentclass[twoside,10pt]{book}

\usepackage[bibencoding=utf8,style=ieee]{biblatex}
\addbibresource{bibl.bib}

\begin{document}

Abc \cite{art}

\printbibliography

\end{document}

bibl.bib:

@article{art,
  author = {someone},
  title = {title}
  booktitle = {book}
}

Expected behavior

Some way to figure out that there is a problem in the bibliography, maybe?

Actual behavior

Random error from Vim which was also (at least for me) fairly untraceable to anything.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Ubuntu 22.04.1 LTS
  Vim version: VIM 9.0 (1-749)
  Has clientserver: true
  Servername: undefined (vim started without --servername)

VimTeX project: thesis
  base: thesis.tex
  root: /home/svalorzen/Tests/latex
  tex: /home/svalorzen/Tests/latex/thesis.tex
  main parser: current file verified
  document class: book
  packages: biblatex blx-case-expl3 etoolbox expl3 iftex ifthen infwarerr keyval kvoptions kvsetkeys logreq ltxcmds pdftexcmds url xparse
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    build_dir: build
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: process 75731 run
      output: /tmp/vzi8uOy/0
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -outdir=build -pvc -view=none -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"' 'thesis.tex'
      pid: 75731
  viewer: General
    job: 
      pid: 75735
      cmd: xdg-open '/home/svalorzen/Tests/latex/build/thesis.pdf'
  qf method: LaTeX logfile
@Svalorzen Svalorzen added the bug label Mar 8, 2023
lervag added a commit that referenced this issue Mar 9, 2023
@lervag
Copy link
Owner

lervag commented Mar 9, 2023

In the middle of a bunch of updates to my latex project I suddenly started receiving the error Vim(let):E684: list index out of range: 1, with no explanation or cause to it.

Thanks for the good issue report. I've reproduced the bug and I believe it is fixed. Please test and report.

vimtex config:

let g:vimtex_enabled=1
" We use latex for tex
let g:tex_flavor = 'latex'
let g:vimtex_compiler_latexmk = {
    \ 'build_dir' : 'build'
\}

You don't need let g:vimtex_enabled = 1, nor let g:tex_flavor = ... - both of these lines can safely be removed.

I started debugging it, and after a very long time, I traced it to a missing comma inside one of my bibliography entries. I'm not sure whether the ergonomics of such an issue can be improved, but I thought of reporting this anyway.

After I've fixed this, your example yields the following errors in the quickfix window:

image

I believe the final entry here should be quite helpful in figuring out the problem.

@lervag lervag closed this as completed Mar 9, 2023
@Svalorzen
Copy link
Author

Seems to work well, thank you for the quick fix!

@lervag
Copy link
Owner

lervag commented Mar 9, 2023

Glad to hear it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants