CTRL Click Fold should Fully Expand/Collapse

This forum should be used for all code folding problems, questions or suggestions. You can also use this forum to request folding support for a new language.
Post Reply
Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

CTRL Click Fold should Fully Expand/Collapse

Post by Rat » Wed Jun 15, 2011 2:05 am

I am used to the Scinitilla editor in Notepad++ where a CTRL-CLICK of a code fold will fully expand or collapse the fold and all its sub-folds... I still haven't found an equivalent functionality in Zeus, (It hasn't stopped me reflexively CTRL-Clicking though ;))

This is of great convenience to developers, since they can easily collapse all the code except the function(s) they're currently working on.

jussij
Site Admin
Posts: 2510
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Wed Jun 15, 2011 2:49 am

I am used to the Scinitilla editor in Notepad++ where a CTRL-CLICK of a code fold will fully expand or collapse the fold and all its sub-folds... I still haven't found an equivalent functionality in Zeus,

These are the only folding functions available in Zeus:

Code: Select all

FoldingMarkedArea   
FoldingOpenAll      
FoldingCloseAll     
FoldingToggleAll    
FoldingToggleAllEx  
FoldingLineOpen     
FoldingLineClose    
FoldingLineToggle   
FoldingFindMatching 
FoldingFindNext     
FoldingFindPrevious 
FoldingViewToggle

For example the FoldingLineToggle is bound to the Alt+Enter key and it will toggle (i.e. open/close) the current fold.
This is of great convenience to developers, since they can easily collapse all the code except the function(s) they're currently working on.
The macro below will do something similar.

Code: Select all

function key_macro()
    screen_update_disable()

    -- NOTE: this should work but does not at present
    -- local line = get_line_pos()

    -- close all the folds
    FoldingCloseAll()

    -- open the current folds
    FoldingLineToggle()

    -- position the function at the top of the page
    ScrollLinePageCenter()

    -- NOTE: this should work but does not at present
    -- restore the origonaL cursor location
    --set_line_pos(line)

    screen_update_enable()
    screen_update()
end

key_macro() -- run the macro
Cheers Jussi

Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

Post by Rat » Mon Jun 20, 2011 2:14 am

The macro below will do something similar.
Sorry Jussi... I tried that macro and it just toggled the current fold.

Ideally what I would like is to be able to click the little '+' or '-' glyph with the CTRL key held down and have the current fold either fully open or close, (ie. including all of its child sub-folds).

A macro that did the same thing would be my next choice.

I normally use this feature by first collapsing the entire document and then fully toggling the function I'm currently editing... I personally find it particularly useful and am currently having to do a lot of '+' and '-' glyph clicking in Zeus everytime I want to view/edit a function... :(

Cheers,
Keith.

jussij
Site Admin
Posts: 2510
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Tue Jun 21, 2011 12:19 am

This Ctrl+Click feature has been added to the latest beta release.

The latest version can be found here: http://www.zeusedit.com/zforum/viewforum.php?f=6

Cheers Jussi
Last edited by jussij on Tue Sep 20, 2011 12:39 am, edited 1 time in total.

Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

Post by Rat » Tue Jun 21, 2011 9:25 pm

That seems to be working very well... I'm very grateful. Now I have CodeWright + Brief + Code Folding in a single package.

BTW in my testing I noticed that the code folding doesn't cope with CDATA embedded in XML, where the CDATA contains HTML tags, see below...

Code: Select all

<marker name="Marker 1">
 <information><![CDATA[<div>This is a div</div>]]></information>
 <icon>images/marker.png</icon>
 <shadow>images/shadow.png</shadow>

 <position>-28.326626, 153.39386</position>

 <visibility>auto</visibility>
 <clickable>1</clickable>
</marker>
Also could you tell me how to assign a key-mapping to "Select All"?


And finally :)... The scintilla editor in Notepad++ has another couple of very nice features which you might want to consider for Zeus.

1. Selecting a word by double-clicking it or searching for it, also highlights every other matching instance, (in another colour). This is very convenient when you are manually changing the name of a variable in a block of code.

2. When editing an XML document, clicking on a tag name automatically highlights both the tag name and its matching closing tag.

jussij
Site Admin
Posts: 2510
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Wed Jun 22, 2011 12:25 am

BTW in my testing I noticed that the code folding doesn't cope with CDATA embedded in XML, where the CDATA contains HTML tags, see below...

I'll take a lok at this.
Also could you tell me how to assign a key-mapping to "Select All"?

Use the Options, Editor Options menu select the Keyboard Mapping panel and then binf the MarkSelectAll function to the required key.
1. Selecting a word by double-clicking it or searching for it, also highlights every other matching instance, (in another colour).

This has been requested before. Unfortunately, I suspect this change would require quite a large number of changes to the searching code in Zeus and as such I am reluctant to make such a big change for a nice to have feature.
This is very convenient when you are manually changing the name of a variable in a block of code.

Here are a few scripts that allow you do these sorts of changes: http://www.zeusedit.com/zforum/viewtopic.php?t=2656
2. When editing an XML document, clicking on a tag name automatically highlights both the tag name and its matching closing tag.
This too has been requested before and is on the list of things to investigate.

Cheers Jussi

Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

Post by Rat » Wed Jun 22, 2011 9:46 am

Jussi wrote:Use the Options, Editor Options menu select the Keyboard Mapping panel and then binf the MarkSelectAll function to the required key.
Thanks...
Jussi wrote:This has been requested before. Unfortunately, I suspect this change would require quite a large number of changes to the searching code in Zeus and as such I am reluctant to make such a big change for a nice to have feature.
Geez Jussi!... thats just not the gold-plated support attitude I've come to expect from you, :wink:
Jussi wrote:This too has been requested before and is on the list of things to investigate.
Kool!

Once again thanks for the excellent support and the great product...

Keith.

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 2 guests