-
Notifications
You must be signed in to change notification settings - Fork 43
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
Unsolicited folds in fenced code blocks #1
Comments
Thanks for reporting this. I'll look into it. |
Please check out the fenced-code-blocks branch to try out a 1st draft solution. It has unit tests, but it could do with some user testing too. I'm concerned that it might have a negative impact on performance, so please report back if you find it to be in any way laggy. |
Thank you for the prompt response and fix! I have tried it with some of my documents and it worked as expected. The documents were not very large, about 200 lines at most, and I did not mention any lags. However, when I created a new document with 1000 lines and more than 50 code blocks, opening it (and folding with zi) took some small yet noticeable amount of time. With 3000 lines my CPU was at 100% for a while. I should mention that the current version from master branch opens the file instantly. |
I've figured out how to profile the performance of the folding script. Here's the bottleneck; the Still room for improvement. |
This patch further improves performance. Testing with the same 1500 line .md file, it's gone from 1.2 seconds to 0.2 seconds. That's more like it! Instead of using |
I think the dependency on vim-markdown is perfectly reasonable. There is a caveat in using the syntax group set by the plugin though. It has an option |
Ok, I think I've covered that now. Try the latest version on the fenced-code-blocks branch. |
That solved the issue! Here is a new one:
This example is contrived, but you can imagine what will happen in a language like Haskell, where comment lines start with two dashes. |
Ok, f5ee87 should fix that. |
Works like a charm, thank you for the effort! |
That's in the master branch now. Thanks for your help with this. |
Hi, thanks for the great plugin!
I have noticed that it does not treat fenced code blocks properly though. Consider the following document:
The plugin treats
#include
directive as a section header and produces two folds:The text was updated successfully, but these errors were encountered: