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

TOC: Selecting a \(sub|subsub)section does not jump to the respective section but produces errors #2

Closed
nasenatmer opened this issue Nov 29, 2013 · 4 comments
Labels

Comments

@nasenatmer
Copy link
Contributor

Hey,

the TOC feature itself works quite well, however,it's impossible to select any section and jump to it (whether it is in the main or input file doesn't matter) by pressing <Enter>. This happens both in gvim and vim.

Here's a MWE:

main.tex

\documentclass{scrartcl}
\begin{document}
 \tableofcontents
  \section{Section in the main file}
  \subsection{Subsection in the main file}
 \input{input}
\end{document}

input.tex

%!Tex Root = main.tex
 \section{Section in the input file}
  This is the file that is being input via \\input
 \subsection{Subsection in the input file}

And here's the errors that I get when I want to switch to input.tex. If I want to switch to a section in main.tex the errors are a bit shorter, but I can't copy them.

Error detected while processing function <SNR>52_toc_activate:
line    3:
E121: Undefined variable: b:toc
E116: Invalid arguments for function len(b:toc)
E15: Invalid expression: n >= len(b:toc)
line    7:
E121: Undefined variable: b:toc
E15: Invalid expression: b:toc[n]
line    9:
E121: Undefined variable: entry
E116: Invalid arguments for function s:toc_escape_title(entry['text'])
E15: Invalid expression: s:toc_escape_title(entry['text'])
line   13:
E121: Undefined variable: entry
E15: Invalid expression: entry['level'].titlestr
line   16:
E121: Undefined variable: b:toc
E15: Invalid expression: b:toc[i]['level'].s:toc_escape_title(b:toc[i]['text'])
line   17:
E121: Undefined variable: i_hash
E15: Invalid expression: i_hash == entry_hash
line   25:
E121: Undefined variable: b:calling_win
E15: Invalid expression: b:calling_win . 'wincmd w'
line   27:
E121: Undefined variable: entry
E15: Invalid expression: [entry['file']]
line   28:
E121: Undefined variable: entry
E116: Invalid arguments for function readfile(entry['file']), 'v:val =~ ''\\input{''')
E116: Invalid arguments for function filter(readfile(entry['file']), 'v:val =~ ''\\input{''')
E15: Invalid expression: filter(readfile(entry['file']), 'v:val =~ ''\\input{''')
line   33:
E121: Undefined variable: entry
E116: Invalid arguments for function <SNR>52_toc_find_match

My vim-latex settings are as follows:

" Settings for vim-latex
  let g:latex_complete_close_braces = 1
  let g:latex_latexmk_quickfix = 1
  let g:latex_latexmk_options = '-xelatex'
  let g:latex_toc_enabled = 1
  let g:latex_toc_hide_help = 1

Am I missing some setting here or is the function broken and you know it already? This is by no means to put any pressure, I'm almost not using this feature, I just noticed it doesn't work here so wanted to let you know :)

@lervag
Copy link
Owner

lervag commented Nov 29, 2013

I've reproduced the issue. I haven't catched this, since I also rarely (or never) use this feature. I'll look into it when I have the time.

@lervag lervag closed this as completed in c9828a6 Nov 29, 2013
@lervag
Copy link
Owner

lervag commented Nov 29, 2013

Should be fixed now.

@nasenatmer
Copy link
Contributor Author

Yes, it works now. There's another thing wrong with the TOC in vim but that'll be a separate issue

@lervag
Copy link
Owner

lervag commented Nov 29, 2013

Ok, I'll look into that when you submit the issue.

slonik-az added a commit to slonik-az/vimtex that referenced this issue Jul 16, 2020
…selected/*.tex' files

Details: several LaTeX macro definitions used `#lervag#1` and `#lervag#2` syntax for variable
expansion on global scope causing errors. Replaced with `lervag#1` and `lervag#2` respectively.
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