how to Custom folding

Topics: Developer Forum
Dec 8, 2009 at 12:50 AM

I want to folding by my keys, what can i do ?(My English is poor)

Developer
Dec 8, 2009 at 9:29 AM
Edited Dec 8, 2009 at 9:31 AM

I guess folding depends on your used lexer. So e.g. if you use cpp lexer it can fold at the occurrence of { or }.

Perhaps this Discussion can help you [link]

Dec 8, 2009 at 1:47 PM

Excuse me ,
Could you help me setting up mssql  support  the key   "  select   from "   to fold.
I don't know how to set lexer .Thank you very much.

Developer
Dec 8, 2009 at 2:38 PM

I think this is not possible with the buildin mssql language, the only possible folding seems to be for the Comments ( /* some Comment  */ ).

To achieve folding for some SQL statement I guess you have to write your own Lexer, which I've never done...

Perhaps Chris Rickard can help you with this problem.

Best Regards

Coordinator
Dec 8, 2009 at 8:01 PM

The mssql lexer supports folding at block comments, begin/end, and case statements. Make sure that you have a fold margin visible (default is Margins[2]) by giving it a non-zero width (20 should be enough).

Dec 9, 2009 at 11:47 PM
Edited Dec 10, 2009 at 7:31 AM

I want to configuration some things to Looks like the picture   http://218.25.154.154:8081/temp/a.jpg 

Dec 14, 2009 at 1:43 PM

you need to modify directly le SciLexer code source into the file LexMSSQL.cxx

 

into the function FoldMSSQLDoc

 you need to add this code source

if ((strcmp(s, "select") == 0) {
	levelCurrent++;
}
if (strcmp(s, "from") == 0) {
	levelCurrent--;
}



 

 

 

 

Dec 15, 2009 at 9:21 AM

HerveC ,Thank you very much!