Page 1 of 1

Customize Editor.ahk custom/comment folding

Posted: 08 Jul 2020, 07:48
by johans2
Screenshot explains what I'm trying to get.

[url=https postimages.org /]Image[/url] Broken Link for safety Broken Link for safety

My knowledge about scintilla and lexers is around zero. So thats all I could figure out. With no succes. How to "force" scintilla to get this folding style?

Code: Select all

	If (g_CodeFolding) {
		Sci[n].SetProperty("fold", "1")
		Sci[n].SetProperty("fold.compact", "0")
		Sci[n].SetProperty("fold.comment", "1")
                Sci[n].SetProperty("fold.explicit.start", ";{")
                Sci[n].SetProperty("fold.explicit.end", ";}")
		SetCodeFolding(n)
	}

Re: Customize Editor.ahk custom/comment folding

Posted: 09 Jul 2020, 14:49
by kczx3
No idea. Maybe try "fold.ahk.explicit.start" and "fold.ahk.explicit.end"? I think this may be dependent on the lexer code though and not configurable from script unless the lexer supports it.

Re: Customize Editor.ahk custom/comment folding

Posted: 30 Aug 2020, 17:48
by Alguimist
@johans2
You can simply do this:

Code: Select all

{
    MsgBox
}
AHK syntax allows a block of code to be enclosed in braces, so there is no need to suppose the existence of parameters for the definition of folding tokens. The AHK lexer has no specific folding properties. Scintilla natively has four: fold, fold.compact, fold.comment and fold.preprocessor.