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

Callback errors when editing bib file #1500

Closed
clason opened this issue Sep 25, 2019 · 4 comments
Closed

Callback errors when editing bib file #1500

clason opened this issue Sep 25, 2019 · 4 comments
Labels

Comments

@clason
Copy link
Contributor

clason commented Sep 25, 2019

Since very recently (I can try bisecting), I get errors when editing a bib file while continuous compilation is running.

Here are the steps to reproduce (files below):

  1. nvim -u minimal.vim test.tex
  2. :VimtexCompile
  3. <c-w c-n>
  4. :e test.bib
  5. make any change
  6. :w

Results in

Error detected while processing function <SNR>36_callback_nvim_output[9]..vimtex#compiler#callback:
line    1:
E716: Key not present in Dictionary: compiler, 'silence_next_callback')
Error detected while processing function <SNR>36_callback_nvim_output[9]..vimtex#compiler#callback:
line    1:
E116: Invalid arguments for function get
Error detected while processing function <SNR>36_callback_nvim_output[9]..vimtex#compiler#callback:
line    1:
E15: Invalid expression: exists('b:vimtex') && get(b:vimtex.compiler, 'silence_next_callback')
Error detected while processing function <SNR>36_callback_nvim_output[9]..vimtex#compiler#callback:
line    1:
E716: Key not present in Dictionary: compiler, 'silence_next_callback')
Error detected while processing function <SNR>36_callback_nvim_output[9]..vimtex#compiler#callback:
line    1:
E116: Invalid arguments for function get
Error detected while processing function <SNR>36_callback_nvim_output[9]..vimtex#compiler#callback:
line    1:
E15: Invalid expression: exists('b:vimtex') && get(b:vimtex.compiler, 'silence_next_callback')

(This is with neovim master; I get different errors with vim 8.1.)

minimal.vim

set nocompatible
let &runtimepath  = '~/.vim/bundle/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/bundle/vimtex/after'
filetype plugin indent on
syntax enable

test.tex

\documentclass{article}
\begin{document}
\nocite{*}                                                                                 
\bibliographystyle{siam}                                                                   
\bibliography{test}                                                                        
\end{document}                   

test.bib

@article{article,
  author  = {Peter Adams}, 
  title   = {The title of the work},
  journal = {The name of the journal},
  year    = 1993,
  number  = 2,
  pages   = {201--213},
  month   = 7,
  note    = {An optional note}, 
  volume  = 4
}
@clason clason added the bug label Sep 25, 2019
lervag added a commit that referenced this issue Sep 25, 2019
@lervag lervag closed this as completed in c3ea1e9 Sep 25, 2019
@lervag
Copy link
Owner

lervag commented Sep 25, 2019

Hmm, I don' think this is a new bug, actually. In any case, I think it is fixed now.

@clason
Copy link
Contributor Author

clason commented Sep 25, 2019

Yes, looks fixed indeed. Thank you very much for the quick fix!

(Weird that I only noticed it now, then; the steps are not so uncommon. Might have been exposed in this situation by a recent change.)

@lervag
Copy link
Owner

lervag commented Sep 25, 2019

No problem!

If you'd open a bib file from inside a tex file, things would have worked well before. But your report used the <c-w><c-e> mapping to open a new empty split first, and then open a bib file. This exposed a minor bug where the b:vimtex variable was set to an empty dictionary, and this lead to the present issue. I assume the reason you might not have seen it before may be because you typically open the bib file from within a tex file?

@clason
Copy link
Contributor Author

clason commented Sep 25, 2019

Hmm, I don't think I did anything differently than usual... I might have been using tabs more often, but I've definitely been using splits before. Anyway, it's fixed now :)

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