Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.