-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support code folding #1442
Comments
This would make an interesting plugin. |
#1045 What happened to this? |
There is a link to a small blog post in that issue, but the developer closed the PR. You can pick up where they left off if you'd like. |
I was able to use his approach with Despite "folding" the code correctly, the line numbers do not fold in tandem and as such were incorrect relative to the document being folded. If the line numbers plugin was updated to be compatible with the presence of |
This would be an awesome feature. :-) |
I've released my implementation of code folding for Prism here: https://github.com/nlundquist/prism-js-fold It works via the No doubt the line numbers plugin will have the same issues mentioned above, however that issue is not a problem with the code folding implementation itself. |
@nlundquist, curious if your extension would work for C#-style "regions" such as: #region Test Region
public void MyMethod()
{
...
}
#endregion At first glance it looks like the code scans just single characters ('[', '{', etc.) at a time, so wouldn't handle finding values like "#region" or "#endregion". Is that correct? |
@tim-626 correct, my plugin would only fold on The approach taken in my plugin is a single character scan, so it would be a bit awkward to patch it to fold on the I'd be happy to recast my plugin as |
It would be great if PrismJS could support cold folding.
The text was updated successfully, but these errors were encountered: