Loading ...
Sorry, an error occurred while loading the content.
 

Re: Fold hierarchy wrong?

Expand Messages
  • Bram Moolenaar
    ... There is a misunderstanding: If you create a level 3 fold, there must also be a level 2 fold. Since there is no end specified for the level 2 fold, it
    Message 1 of 3 , Sep 1, 2001
      Michael Sternberg wrote:

      > Folding using markers appears to have difficulties keeping the fold levels.
      > I attach a sample file with a modeline (muted here):
      >
      > v_i_m_6:foldmethod=marker foldlevel=1:
      >
      > The example defines an outer fold on level 1 and two inner folds on
      > level 3. Upon startup, the inner folds show up collapsed as ONE
      > level 3 fold instead of two. Opening and immediately closing this
      > fold (zozc) gives the proper result of two collapsed level 3 folds.

      There is a misunderstanding: If you create a level 3 fold, there must
      also be a level 2 fold. Since there is no end specified for the level 2
      fold, it ends just above the "}}}1". This is the single fold that you
      see.

      Try setting 'foldcolumn' to 5 or so, then you can clearly see what is
      going on.

      There is currently no way to skip the level 2 fold. It would be very
      difficult to define how this would work.

      --
      ARTHUR: A scratch? Your arm's off!
      BLACK KNIGHT: No, it isn't.
      ARTHUR: Well, what's that then?
      BLACK KNIGHT: I've had worse.
      The Quest for the Holy Grail (Monty Python)

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    • Michael Sternberg
      ... I see indeed. I had the feeling this really is out-of-spec, given that folds define a rigorous tree [similar to PDF bookmarks, which have very much the
      Message 2 of 3 , Sep 1, 2001
        On Sat, Sep 01, 2001 at 10:44:08PM +0200, Bram Moolenaar wrote:
        > Michael Sternberg wrote:
        > > The example defines an outer fold on level 1 and two inner folds on
        > > level 3. Upon startup, the inner folds show up collapsed as ONE
        > > level 3 fold instead of two. Opening and immediately closing this
        > > fold (zozc) gives the proper result of two collapsed level 3 folds.
        >
        > There is a misunderstanding: If you create a level 3 fold, there must
        > also be a level 2 fold. Since there is no end specified for the level 2
        > fold, it ends just above the "}}}1". This is the single fold that you
        > see.
        >
        > Try setting 'foldcolumn' to 5 or so, then you can clearly see what is
        > going on.

        I see indeed. I had the feeling this really is out-of-spec, given
        that folds define a rigorous tree [similar to PDF bookmarks, which
        have very much the same structure and restriction]. It is nice to
        see, though, that the level 2 fold is created automatically, so it
        appears to work more or less as intended.


        Regards,
        --
        Michael Sternberg, Dipl. Phys. | Uni-GH Paderborn
        http://www.phys.uni-paderborn.de/~stern/ | FB6 Theoretische Physik
        phone: +49-(0)5251-60-2329 fax: -3435 | 33098 Paderborn, Germany
        "Who disturrrbs me at this time?" << Zaphod Beeblebrox IV >> <*>
      Your message has been successfully submitted and would be delivered to recipients shortly.