LaTeX-Box-Team / LaTeX-Box

Lightweight Toolbox for LaTeX - New Official repository
http://www.vim.org/scripts/script.php?script_id=3109
GNU General Public License v3.0
396 stars 66 forks source link

TOC jumping issue with autochdir and inputs #201

Open nbren12 opened 10 years ago

nbren12 commented 10 years ago

I have an multifile document that includes files from the current and parent directories, and I am experiencing the following error when trying to jump to section using the TOC.It only occurs when I have set autochdir in my vimrc:

autocommand syn region UtlUrl matchgroup=UtlTag start="<LNK:" end=">" containedin=ALL

Executing BufWinEnter Auto commands for "*"
autocommand syn case match

chdir(/Users/noah/Dropbox/stochmc)
Error detected while processing function <SNR>89_TOCActivate..<SNR>89_TOCFindMatch..<SNR>89_TOCFindMatch..<SNR>89_TOCFindMatch..<SNR>89_TOCFindMatch..<SNR>89_TOCFindMatch..<SNR>89_TOCFindMatch:
line    2:
Could not find: \\subsection\_\s*{Wave structure}
Executing BufWinLeave Auto commands for "*"
autocommand execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave')

Executing BufWinLeave Auto commands for "*"
autocommand if s:diff_window_count() == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | call s:diffoff_all(getbufvar(+expand('<abuf>'), 'git_dir')) | endif

After this error message, the window displays an empty buffer in the _parent directory_ of the directory containing my main latex file! It seems like autochdir is changing the current directory to the location of one included file, but does not jump back.

lervag commented 10 years ago

Interesting. I don't think I've met anyone who uses the autochdir before. It seems the TOC system relies on relative paths, which obviously does not work well with autochdir. This should be fixed. I might try when I get some more time, but I already have other bugs in my mind right now.