From Komodo bug http://bugs.activestate.com/show_bug.cgi?id=100627 :
"""
The SQL editor only recognizes "CREATE TABLE tabelname ( ..." as a foldable section.
I'ld expect that a multi-line CREATE VIEW viewname AS ... ; also be recognized as a foldable section.
A little experiment show that the recognizer requires a '(' somewhere on the same line as
CREATE VIEW and a somewhere down a (balancing) closing ")" . That is not correct (may be allowable in some implementations, but certainly not all) SQL syntax.
Because VIEW, PROCEDURE, INDEX and TRIGGER statements can be quite large folding would be a very nice "summarizing" tool.
"""
This patch implements that, and also makes sure each call to LexerSQL::Fold encompasses the line after the last ';' before startPos, and ends at the next ';' after the requested end-position, because find resolution is done on non-comment non-string ';'s.
Using unsigned long for sql_state_t makes the size platform-dependent with it being 64-bit only on 64-bit Unix. Since its a bit mask and must work for 32-bits, having it sometimes be 64-bit has no benefit so more consistent to use an unsigned int which is always 32-bits.
....\scintilla\lexers\LexSQL.cxx(643): warning C4189: 'origEndPos' : local variable is initialized but not referenced [C:\u\hg\scite\win32\SciTE.vcxproj]
Revised patch.
Final (I hope) patch -- there was a mistake in a couple of the enum's, so I aligned
the hex values to make it easier to pick out the differences.
Fix committed as [1daf52].
Related
Commit: [1daf52]