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

Possible bug in fold mechanism?

Expand Messages
  • Brett Pershing Stahlman
    With foldmethod set to marker, I would expect that performing a recursive close (zC) on the outer fold in the following example would cause the inner fold to
    Message 1 of 3 , Apr 1, 2002
    • 0 Attachment
      With foldmethod set to marker, I would expect that performing a recursive close (zC) on the outer fold in the following example would cause the inner fold to close as well. However, if I do a non-recursive open (zo) on the outer fold immediately after the recursive close, the inner fold is open. If the inner fold had been closed by the recursive close, it should still appear closed after the enclosing fold is opened non-recursively. Am I missing something here?
       
      outer fold {{{
         inner fold {{{
            Why doesn't this
            fold close when zC
            is done on outermost
            fold?
         }}}
      }}}
       
      Thanks,
          Brett S.
    • Bram Moolenaar
      ... The zC command recursively closes folds *under the cursor*. Thus if the cursor is in the inner fold, that one is closed. If the cursor is on the first
      Message 2 of 3 , Apr 2, 2002
      • 0 Attachment
        Brett Pershing Stahlman wrote:

        > With foldmethod set to marker, I would expect that performing a
        > recursive close (zC) on the outer fold in the following example would
        > cause the inner fold to close as well. However, if I do a non-recursive
        > open (zo) on the outer fold immediately after the recursive close, the
        > inner fold is open. If the inner fold had been closed by the recursive
        > close, it should still appear closed after the enclosing fold is opened
        > non-recursively. Am I missing something here?
        >
        > outer fold {{{
        > inner fold {{{
        > Why doesn't this
        > fold close when zC
        > is done on outermost
        > fold?
        > }}}
        > }}}

        The "zC" command recursively closes folds *under the cursor*. Thus if
        the cursor is in the inner fold, that one is closed. If the cursor is
        on the first line of the outer fold, the inner fold isn't closed.

        --
        Never overestimate a man's ability to underestimate a woman.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
        \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Brett Pershing Stahlman
        Bram, OK. I understand what is meant by folds under the cursor ; however, I would submit that in fold.txt, the term recursively is used differently in the
        Message 3 of 3 , Apr 2, 2002
        • 0 Attachment
          Bram,
          OK. I understand what is meant by folds "under the cursor"; however, I
          would submit that in fold.txt, the term "recursively" is used differently in
          the documentation on zC and zD: As Srinath pointed out, the recursion is
          "outward" in the case when a zC is performed from within a contained fold
          (i.e., the fold under cursor and all *containing* folds are closed as well);
          however, zD works recursively by deleting the fold under cursor and all
          *contained* (nested) folds. Although zD help mentions "nested folds", it
          does not make clear whether such nested folds are deleted always or in
          visual mode only.

          Thanks,
          Brett S.

          ----- Original Message -----
          From: Bram Moolenaar <Bram@...>
          To: Brett Pershing Stahlman <brett.stahlman@...>
          Cc: <vim@...>
          Sent: Tuesday, April 02, 2002 1:24 PM
          Subject: Re: Possible bug in fold mechanism?


          >
          > Brett Pershing Stahlman wrote:
          >
          > > With foldmethod set to marker, I would expect that performing a
          > > recursive close (zC) on the outer fold in the following example would
          > > cause the inner fold to close as well. However, if I do a non-recursive
          > > open (zo) on the outer fold immediately after the recursive close, the
          > > inner fold is open. If the inner fold had been closed by the recursive
          > > close, it should still appear closed after the enclosing fold is opened
          > > non-recursively. Am I missing something here?
          > >
          > > outer fold {{{
          > > inner fold

          > > Why doesn't this
          > > fold close when zC
          > > is done on outermost
          > > fold?
          > > }}}
          > > }}}
          >
          > The "zC" command recursively closes folds *under the cursor*. Thus if
          > the cursor is in the inner fold, that one is closed. If the cursor is
          > on the first line of the outer fold, the inner fold isn't closed.
          >
          > --
          > Never overestimate a man's ability to underestimate a woman.
          >
          > /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net
          \\\
          > /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim
          \\\
          > \\\ Project leader for A-A-P -- http://www.a-a-p.org
          ///
          > \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org
          ///
        Your message has been successfully submitted and would be delivered to recipients shortly.