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

Re: couple of requests on folds

Expand Messages
  • Bram Moolenaar
    ... You mean that something like this: if (cond) { st1; st2; } Would be folded as a whole? Hmm, but this: if (cond) { st1; st2; } Requires that two lines are
    Message 1 of 3 , Oct 17, 2000
    • 0 Attachment
      Raul wrote:

      > 1) how about foldmethod=hierarchy, similar to fdm=indent but also
      > including the "parent" (in other words, extending fdm=indent
      > folds 1 line up)

      You mean that something like this:


      if (cond) {
      st1;
      st2;
      }

      Would be folded as a whole? Hmm, but this:

      if (cond)
      {
      st1;
      st2;
      }

      Requires that two lines are included. This probably requires using expression
      folding. Mostly you can use expression folding to do indent folding "with
      something extra".

      > 2) why fdm=manual doesn't allow 1 line folds?
      > other methods do.
      > or at least make it just a warning that doesn't stop macros.
      > sometimes I want to hide specific sections of a file and
      > recording a register would be just perfect for quick-1-time
      > folds... if it hadn't to check how many lines are included

      This is a leftover from the time I thought one-line folds were not useful.
      But they are useful for wrapped lines, thus I'll allow them.

      > 3) lets suppose after a search the cursor ends on a closed nested
      > fold and I want to open as many folds as needed to see that
      > line...
      > zO opens every fold in there, way too many.
      > zo opens just the uppermost fold
      > instead of having to type zo several times, a count would do
      > the trick: 9zo = zozozo... ...if zo accepted a count :(
      > would be possible to make zo to accept a count?
      > is there already a command to do what I want, that I'm missing?

      There is no command to open folds until the cursor line isn't folded. If we
      are adding a count to "zo", perhaps "1zo" could do this? Hmm, this command
      could be used a lot, better find a short name for it. "zv" could be used.

      --
      "My particular problem is with registry entries, which seem to just accumulate
      like plastic coffee cups..." -- Paul Moore

      /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
      \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.