Skip to content

Spurious extra folds slow down navigation #278

@chiphogg

Description

@chiphogg

Take any python file with several consecutive classes, and zM to fold the file completely. The display will alternate between folded class lines and blank lines:

class A(object):...

class B(object):...

class C(object):...

# etc.

(All the class ... lines are folds, not actual lines.)

Problem: It appears that the intervening blank lines are also folds.

When I go to a class line and type zj to go to the next fold, it takes me to the blank line. I have to hit zj again to go to the next line. Thus, going to the next class is zjzj instead of zj.

Yes, I know I could just do jj. :) But that misses the point: when I see these lines folded, I expect zj will take me to the next fold, and it's jarring when that doesn't happen.

In fact, I just tried an experiment: I inserted several extra blank lines between classes. Every one of them gets hit by zj.

More directly, :echo foldlevel('.') gives 1 for any of these lines, but 0 for any of the import lines at the top (which aren't folded).

Any chance we could have intervening blank lines set to foldlevel 0? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy