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

Unexpected fold #207

Open
fluecke opened this issue Aug 6, 2014 · 3 comments
Open

Unexpected fold #207

fluecke opened this issue Aug 6, 2014 · 3 comments

Comments

@fluecke
Copy link

fluecke commented Aug 6, 2014

Some snippet plugins (namely ultisnips/snipmate) put the user into select mode when completing a snippet, which triggers the autocommand to switch foldmethod to expr and in turn causes the folding to update. This may cause text that is beeing edited to be folded, which prevents the user from naming the completed environment.

To reproduce, install Latex-Box, ultisnips and vim-snippets, then open a new tex document, containing only a \documentclass{...} command, enter "begin" and complete the snippet.

\documentclass{...}
begin$                % $ is the cursor, complete snippet here

I have solved the problem by changing LatexBox_FoldLevel to always return 0 for the current environment (LatexBox_GetCurrentEnvironment), I'm not sure though if that is the way to go, but I don't know vimscript and this is the best I could do.

@lervag
Copy link

lervag commented Aug 10, 2014

Interesting. I'll see what I can do. In the mean time, I can recommend the relatively new option to manually update the folds. See the docs for g:LatexBox_fold_automatic.

@fluecke
Copy link
Author

fluecke commented Aug 10, 2014

Thanks, works like a charm. 👍

@lervag
Copy link

lervag commented Aug 10, 2014

Great!

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

No branches or pull requests

2 participants