[code] Still wrestling with oddball folds.

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Tue, 7 Jan 2014 15:27:44 +0800

I have some code that looks like this: https://gist.github.com/8295648

I want to fold from the beginning at ":-" to the end at "integer_dot(int)."
 (Ignore the line comments; the line comment folding is enough for that for

Now given the following code, the fold ends at the "." in "
io_error(io.error)" which makes a certain amount of sense given the rules
provided, but is obviously not what's desired:

M._foldsymbols = {
  _patterns = { '%:%-', '%.', },
  [l.OPERATOR] = {
    [':-'] = 1,
    ['.'] = -1,

Making the _pattern for closing be something like '%.%s' (and several other
attempts along those lines) gives me folds that close only at the end of
the file.

What trick am I missing for making this work the desired way?

For reference, l.OPERATOR is defined thusly:

local operator_term = l.delimited_range('`', true, false)
local operator_chars = S('.!:@^*-\\/<>()[]{}+=')
local operator = token(l.OPERATOR, operator_term +

"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 07 Jan 2014 - 02:27:44 EST

This archive was generated by hypermail 2.2.0 : Tue 07 Jan 2014 - 06:50:49 EST