[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[StrongED] Better C folding



I noticed that the default C ModeFile doesn't fold functions
perfectly. For example it doesn't match a function that returns
"unsigned long long int".

So here's a replacement that I believe works better. This should also
improve the "list of functions" (Shift-F2).

I'm not sure what FoldParm1 does but that's the line from the default ModeFile:

FoldParm1 ("/*{{{", "/*}}}", StartSpace, Case)
FoldParm2 (Function, "}", StartOfLine, Case)

In the Search section I've altered the Function pattern:

 function_ ("extern" | "volatile" | "static" | "signed" | "unsigned" |
"long") {" "}
 Function < {function_} ~"else" ~"return" {AD|"_"}+ {' *'}+ {AD|"_"}+
{" "} "(" * ")" {\s} "{"

Hope this is useful.

-- 
Richard Griffin
Software Engineer, Denbridge Marine Ltd

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx