Monday, December 10, 2012

reStructuredText Codeless Language Module

Eric Knibbe has written a BBEdit codeless language module for reStructuredText. It seems to accurately find the functions (headings), comments, and hyperlinks. However, it suffers from the same problem I ran into when building my own CLM for reStructuredText: on certain files, it is incredibly slow, to the point of making typing unpleasant. This is probably due to pathological regular expression matching.

I ended up building my CLM to not look for functions at all. Instead, I use an attachment script on documentWillSave to find the headings and create markers for them. On the plus side, this is much faster and allows me to indent the markers according to the document structure. Unfortunately, since BBEdit does not see the headings as actual functions, it does not allow me to fold them.

1 Comment RSS · Twitter

I actually rewrote its string matching regex two years later to avoid potential backtracking issues, if you're willing to try it again.

Leave a Comment