On Aug 22, 2007, at 4:46 PM, Maarten Sneep wrote:
I want to edit some files that use the Windows ini syntax (they are
actually configuration files for an application written in Python).
I tried to write my own CLM, but failed (and the samples in the SDK
use the older syntax, no the new grep based one, so no help there).
Does anyone have such a CLM, or can someone help me to fix my code?
Here are my suggestions:
<key>Function Pattern</key>
<string>^[ \t]*(?P<function>\[(?P<function_name>
[[:print:]]+?)\](?s:.*?)?)[[:space:]]*(?=(^[ \t]*\[|\z))</string>
<key>Comment Pattern</key>
<string>(#|;).+$</string>
Notes:
Make sure your function pattern matches the body too. This gets you
folding and avoids a current bug with one line functions when using
the regex based function scanner.
Don't used a named pattern for your comment pattern, just match the
comments. (Especially not the name "comment". BBEdit uses this
internally as an implementation detail, and if you use it too, it
conflicts with BBEdit's usage, and things break.)
Jim
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>