Page 1 of 1
CTRL Click Fold should Fully Expand/Collapse
Posted: Wed Jun 15, 2011 2:05 am
by Rat
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.
Posted: Wed Jun 15, 2011 2:49 am
by jussij
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
Posted: Mon Jun 20, 2011 2:14 am
by Rat
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.
Posted: Tue Jun 21, 2011 12:19 am
by jussij
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
Posted: Tue Jun 21, 2011 9:25 pm
by Rat
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.
Posted: Wed Jun 22, 2011 12:25 am
by jussij
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
Posted: Wed Jun 22, 2011 9:46 am
by Rat
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,
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.