Dear Monks, as some here might know i'm writing a editor with Perl. Recently (see here and there, yes it runs under linux, even if there still a hook to it - I'm working on that) i added code folding, what practically scintilla does for me. but unlike Kommodo i added now also key binding, so that you can do everything with keyboard too.

This is only possible because I have only 2 functions (unlike the 6 in Kommodo) which do in my respected view more than these 6. Please let me explain. These 6 functions collapse in first place to 3 because there are fold/unfold twins, but in my OSO (obviously superior opinion) you can only do one of the 2 at once. And since the fold marker tells you in what state the current line is (and you can expect what to happen), just toggle should be enough. Then you have the "fold recursive" call, which also makes no sense to me, because when i fold the head, I don't care if an invisible line is folded in the internal representation of scintilla. with "fold all" I have similar issue. folding/unfolding the current node on click or with key combo is something legitimatly expected, but often when you find yourself clicking through the nodes you want something different instead.

Kephra foldes now (since 0.4.1) on middle click all siblings of this node (e.g. all subs) so you can get a nice overview with only one click over the area of interest. If you prefer keyboard you just have to take additional shift key to get that alternative behaviour.

Please let me know what is your take on this or if you have even some better ideas.

UPDATE: I know implemented 4 functions for TIMTOWTDI. the 2 new are: toggle all and toggle recursive. surprise!

thanks for reading.

Kephra, a beautiful Perl Editor lives at http://kephra.sourceforge.net

In reply to Code Folding by sir_lichtkind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.