News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Customize Folding

Started by greensoap, August 08, 2007, 01:30:13 AM

Previous topic - Next topic

greensoap

I prefer when folding shows the ending brace, opposed to the way Code::Blocks hides the ending brace. Can anyone point me in the right direction so that I can modify the code for my own preference.

I tried following the logic in the code, but honestly got pretty confused...

Thanks, Jon

dmoore

I agree that it looks a little odd without the closing brace

SetFoldFlag(flag) method of wxscintilla might do the job you need. the flags are:


#define wxSCI_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
#define wxSCI_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
#define wxSCI_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
#define wxSCI_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
#define wxSCI_FOLDFLAG_LEVELNUMBERS 0x0040
#define wxSCI_FOLDFLAG_BOX 0x0001


I haven't tested to see if any of these actually will do what you need

a lot of the editor custom config is done around line 940 of cbeditor.cpp

Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

jazzer

Is it possible to setup Scintilla to fold like MSVC8 does?
It removes both opening and closing brackets, converting something like
if ()
{
  // code nere
}

to
if () [...]
where [...] is clickable (click does expanding)

raph