Re: [scintilla] Visual Studio-like folding

152 views
Skip to first unread message

Neil Hodgson

unread,
Nov 11, 2012, 1:54:45 PM11/11/12
to scintilla...@googlegroups.com
> Is it possible to tune scintilla to fold like Visual Studio?
> If not, may be somebody already has mod of scintilla able to do it?
> If not, is it possible and what src files should I alter to achieve this effect?

Scintilla's folding differs from Visual Studio in several ways. You could describe the particular features you want.

Neil

stas

unread,
Nov 11, 2012, 2:31:20 PM11/11/12
to scintilla...@googlegroups.com, nyama...@me.com

>    Scintilla's folding differs from Visual Studio in >several ways. You could describe the particular >features you want. 

Basically I meant  2 things:

- minus sign corresponds to main:

- in folded state both { and } are hidden into thing after main():



Neil Hodgson

unread,
Nov 12, 2012, 3:04:15 AM11/12/12
to scintilla...@googlegroups.com
stas <sta...@yahoo.com> wrote:
- minus sign corresponds to main:

- in folded state both { and } are hidden into thing after main():

    These would both require considerable work. Changing the fold points requires adding code to the C++ folder in the levers sub-directory. Adding extra line-end graphics would require adding some more drawing code to Editor.cxx and some storage for the extra state to remember the type of graphic.

   Neil

stas

unread,
Nov 12, 2012, 4:04:59 AM11/12/12
to scintilla...@googlegroups.com, nyama...@me.com
Thank you.

Edwin

unread,
Dec 15, 2012, 11:43:17 AM12/15/12
to scintilla-interest
Hi Neil,

As an idea, I think if you provide some kind of 'custom draw'
mechanism for Scintilla, such features can be easily added by us
Scintilla users.

What I mean is to allow us to write some callback functions to draw on
top of the editor control and handle keyboard/mouse inputs...

I recall another recent question about visualizing code blocks - that
one can be solved with 'custom draw' too...

Just my two cents.

On Nov 12, 4:04 pm, Neil Hodgson <nyamaton...@me.com> wrote:
> stas <stas...@yahoo.com> wrote:
> > - minus sign corresponds to main:
>
> > - in folded state both { and } are hidden into thing after main():
>

Neil Hodgson

unread,
Dec 28, 2012, 5:40:56 AM12/28/12
to scintilla...@googlegroups.com
Edwin:

> As an idea, I think if you provide some kind of 'custom draw'
> mechanism for Scintilla, such features can be easily added by us
> Scintilla users.

This is a difficult major feature. It has been considered before and is unlikely to be included.

Neil

Edwin Yip - Dev of LIVEditor

unread,
Jan 2, 2013, 10:09:27 AM1/2/13
to scintilla-interest
Hi Neil,

Thanks for answering and happy new year (to others too :)!

May I ask why the idea was given up? Requires significant architecture
change? If it's about performance I don't think it's a problem since
if we don't use that feature we'll not have performance loss and if we
do, we are prepared for that.

Neil Hodgson

unread,
Jan 2, 2013, 4:52:26 PM1/2/13
to scintilla...@googlegroups.com
Edwin Yip:

> May I ask why the idea was given up? Requires significant architecture
> change?

There are many issues including controlling drawing resource usage, protecting clients against drawing surface changes (such as using separate surfaces for margins), coping with the callback performing unexpected actions and providing a platform-independent drawing API. Most of the suggested uses, including the recent changed fold drawing suggestion, can not be implemented with a simple custom draw notification, but would affect other features (are line end symbols moved after the [ ... ]?, ...) and require maintaining extra state.

There would also be a support cost particularly with bugs in custom drawing implementations.

Neil

Reply all
Reply to author
Forward
0 new messages