Re: GtkSourceView: code folding



Hi

On Tue, 2014-08-12 at 16:28 +0200, Sébastien Wilmet wrote:
On Tue, 2014-08-12 at 15:55 +0200, flix wrote:
Well, yes, actually I've already made the gutter part myself and it's 
working great (zoom included). Initially I just used the default 
implementation Gsv provides for Gsv::Mark icons (by swapping a 
'collapsed mark' with an 'expanded mark' to change state): it worked, 
but with a custom gutter rendered I managed to use just one mark 
(extended to contain the folding state) for both states, and to make 
zooming work in the gutter icons too.

What do you call "zooming" in the context of code folding?
With a custom gutter renderer you can draw also a vertical line below
the + buttons, to show where the "foldable" region stops (like Scintilla
does). Or you can draw different background colors, like Qt text editors
do.

However the main problem of my post is that the TextChildAnchor is 
necessary if we want to handle collapsed regions properly (for example 
for saving all the possible space, or to implement free collapsable 
regions, like in C#)

I don't follow you, what is a free collapsable region? A block beginning
and ending in the middle of a line? If so, is the code folding really
useful for such blocks?

Btw, the code folding is still not implemented in GtkSourceView or gedit
because we don't think it is a really useful feature. Having the
structure of the file in the side panel is more useful in my opinion.
Like the list of functions, or the list of chapters, sections, etc of a
LaTeX document.
<snip/>

The problem with editors ( such as anjuta) , the symbols are
alphabetically sorted while the order in file is "logically" written.

With code folding, one could simulate "split-view" .

-- 
Cheers
-- ritz
One Bell System - it used to work before they installed the Dimension!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]