#120 Code-Folding makes 2 newlines out of 1

v0.3.0
closed-fixed
nobody
Editor (234)
5
2005-01-25
2005-01-18
No

Hi everyone.

I've upgradet to 3.0.8 today and asides that I would
love code-folding not only for subs (yep, already a
RFE) I found that such constructs:

sub a {
...
}

sub b {
...
}

becomes

sub a {

sub b {
...
}

if sub a is folded. I have one-lined spaces between
blocks at general. So this would be the only spaces in
my code. And especially for some tools with 3-5
liner-sub's it would be nice to win space by folding,
not losing it ;)

So, that's it. Nothing wild at all, just a bit about
personal aesthetics.

Discussion

  • LeO

    LeO - 2005-01-18

    Logged In: YES
    user_id=703323

    Uha, I think I know where the bug is, cause for folding
    everything up till the last Bracket will be added and then
    folded. Since linefeed is not there, it remains. You could
    easily test it with

    sub a {
    ...
    } test

    Q: Although invalid code above, should it be collapesed till
    the end of line??? (As it does in Eclipse-Java)

     
  • Robert Sedlacek

    Robert Sedlacek - 2005-01-18

    Logged In: YES
    user_id=739213

    I would say 'Yes'. Reason: What are you gonna write there?
    In my code there are only things belonging to that block
    (which is folded). In larger subs I often do something like

    if( $cond ) { #> condition comment
    # many lines of code (here-docs, sql, etc.)
    } # end: condition testing for..

    This enables me to know where I have to put, for example,
    the closing of a file after a larger block, because I know
    where the block ends. OTOH if you're planning making other
    forms of blocks (map, etc.) foldable, this might not be the
    way to go.

    Would it be possible to differ between "folding by lines"
    and "folding by block"? I think this idea is starting to
    grow to a RFE..

    p

     
  • LeO

    LeO - 2005-01-18

    Logged In: YES
    user_id=703323

    I see the answer to my question, but the sample to the
    raised RFE.

    So, could we just summarize the points refering to this
    issue, and treat separete the RFE issue?

     
  • Robert Sedlacek

    Robert Sedlacek - 2005-01-18

    Logged In: YES
    user_id=739213

    Yep: I would say Code-Folding should include the line of the
    closing bracket inclusive newline. Folding is indicated by
    the linenr-margin, so I think a more per-line-behaviour
    would be most intuitive as default.

    p

     
  • LeO

    LeO - 2005-01-25
    • status: open --> closed
     
  • LeO

    LeO - 2005-01-25
    • status: closed --> closed-fixed
     
  • LeO

    LeO - 2005-01-25

    Logged In: YES
    user_id=703323

    Is fixed in 0.3.9.

     
  • Robert Sedlacek

    Robert Sedlacek - 2005-01-25

    Logged In: YES
    user_id=739213

    Confirmed. Thanks, nice work!

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks