#1007 Python unfold all quirk

v1.24
closed-fixed
None
v1.23.1
5
2014-08-18
2013-11-17
memeplex
No

If you fold then unfold all by shift clicking the - at the left of "def f():" in the document below, you will notice that the "pass" line remains folded. This doesn't happen when that line is the last one in the document (that's the reason why there's a comment at the end). Strangely enough this neither happens when you fold/unfold all using the Document menu.

def f():
    if not True:
        pass

# something else

Related

Bugs: #1007

Discussion

  • memeplex
    memeplex
    2013-11-17

    Sorry I don't seem to be able to edit the description, I didn't know sourceforge was using markdown, here is the code again:

    def f():
        if not True:
            pass
    
    # something else
    
     
  • Lex Trotman
    Lex Trotman
    2013-11-18

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,7 @@
     If you fold then unfold all by shift clicking the - at the left of "def f():" in the document below, you will notice that the "pass" line remains folded. This doesn't happen when that line is the last one in the document (that's the reason why there's a comment at the end). Strangely enough this neither happens when you fold/unfold all using the Document menu.
    
    -def f():
    -    if not True:
    -        pass
    -
    -# something else
    +    def f():
    +        if not True:
    +            pass
    +    
    +    # something else
    
    • status: open --> open-accepted
     
  • Lex Trotman
    Lex Trotman
    2013-11-18

    Confirmed latest GIT. Does not happen with Scite, so not Scintilla bug.

    PS edited the original message because the huge something else was very annoying

     
  • Enrico Tröger
    Enrico Tröger
    2013-11-22

    I think this isn't a bug because you can configure the behaviour in the preferences dialog -> Editor -> "Fold/unfold all children of a fold point". After activating this preference, the if condition is unfolded as well.

    Do you agree?

     
  • memeplex
    memeplex
    2013-11-22

    Hi Enrico,

    according to the docs shift clicking reverts the effect of the option
    you mention. So it should work either way (unchecked w/shift and checked
    wo/shift). Am I wrong?

    Regars

    Carlos

    On 22/11/13 10:47, "Enrico Tröger" wrote:

    I think this isn't a bug because you can configure the behaviour in
    the preferences dialog -> Editor -> "Fold/unfold all children of a
    fold point". After activating this preference, the if condition is
    unfolded as well.

    Do you agree?


    [bugs:#1007] http://sourceforge.net/p/geany/bugs/1007/ Python
    unfold all quirk

    Status: open-accepted
    Created: Sun Nov 17, 2013 11:28 PM UTC by memeplex
    Last Updated: Mon Nov 18, 2013 12:56 AM UTC
    Owner: nobody

    If you fold then unfold all by shift clicking the - at the left of
    "def f():" in the document below, you will notice that the "pass" line
    remains folded. This doesn't happen when that line is the last one in
    the document (that's the reason why there's a comment at the end).
    Strangely enough this neither happens when you fold/unfold all using
    the Document menu.

    def f():
    if not True:
    pass

    something else


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/geany/bugs/1007/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #1007

  • Lex Trotman
    Lex Trotman
    2013-11-22

    @Enrico

    I'm afraid you may be wrong, at least for me current Git with standard options, using exactly the OPs code fragment, does not unfold the pass line when you unfold the def line, no matter what that setting.

    This is not a major issue as it needs the exact circumstances to not unfold, its only the last level that doesn't unfold, for example nesting further, and only if that level is a single line (AFAICT). But it is annoying if the last line of a function which is not the end of the file does not unfold.

     
  • This was due to an off-by-one issue, resulting on the very last line of a nested fold level not to be expanded. This was of course only visible if that last line was alone in its fold level, otherwise folding the N-1 line was enough.

    Fixed with [f99e627bb0d28821168a44553f92fd5dd60eafe3]

     

    Related

    Commit: [f99e62]

    • status: open-accepted --> closed-fixed
    • assigned_to: Colomban Wendling
    • Fixed in: v1.23.1 --> v1.24