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

Infinite recursion with subimport, name collision & .latexmain file #2739

Closed
BarrensZeppelin opened this issue Jun 21, 2023 · 1 comment
Closed
Labels

Comments

@BarrensZeppelin
Copy link

Description

When opening an imported file with the setup shown below, the file_reaches_current function goes in an infinite loop.

Steps to reproduce

Create the following files:

main.tex

\documentclass{article}
\usepackage{import}
\begin{document}
\subimport{chapters/}{main.tex}
\end{document}

main.tex.latexmain
<empty>

chapters/main.tex

hello

And run vim chapters/main.tex

Expected behavior

The chapters/main.tex file should open normally and the root main.tex file should be identified as the project root.

Actual behavior

I get the following error message:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:21: Error executing lua: /usr/share/nvim/runtime/filetype.lua:22: BufReadPost Autocommands
for "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[19]..script .config/nvim/plugged/vimtex/ftplugin/tex.vim[25]..function vimtex#i
nit[7]..<SNR>73_init_state[1]..vimtex#state#init[1]..<SNR>79_get_main[27]..<SNR>79_get_main_latexmain[3]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reach
es_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>7
9_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current
[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_rea
ches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR
>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_curre
nt[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_r
eaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<S
NR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_cur
rent[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file
_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..
<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_c
urrent[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_fi
le_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]
..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches
_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_
file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[1
6]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reach
es_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>7
9_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current
[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current[16]..<SNR>79_file_reaches_current, line 8: Vim(if):E132
: Function call depth is higher than 'maxfuncdepth'
stack traceback:
        [C]: in function 'nvim_cmd'
        /usr/share/nvim/runtime/filetype.lua:22: in function </usr/share/nvim/runtime/filetype.lua:21>
        [C]: in function 'nvim_buf_call'
        /usr/share/nvim/runtime/filetype.lua:21: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        /usr/share/nvim/runtime/filetype.lua:21: in function </usr/share/nvim/runtime/filetype.lua:10>

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Linux 6.3.8-arch1-1
  Vim version: NVIM v0.9.1
  Has clientserver: true
  Servername: /run/user/1000/nvim.57361.0

VimTeX project: main
  base: main.tex
  root: /tmp/vimtex
  tex: /tmp/vimtex/main.tex
  main parser: current file verified
  document class: article
  packages: import
  source files:
    main.tex
    chapters/main.tex
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile
@lervag
Copy link
Owner

lervag commented Jun 21, 2023

Thanks! It should be fixed now, I think.

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