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

Request for a fold option...

Expand Messages
  • Tim
    In the docs, it says: When moving the cursor downwards, it will move to the first line of a sequence of folded lines. When the cursor is already on a folded
    Message 1 of 7 , Aug 3, 2000
    • 0 Attachment
      In the docs, it says:

      When moving the cursor downwards, it will move to the first line of a
      sequence
      of folded lines. When the cursor is already on a folded line, it
      moves to the
      next unfolded line.

      When moving the cursor upwards, it will
      move to the last line of a seqyence of
      folded lines. When the cursor is
      already on a folded line, it moves to the
      previous unfolded line.

      I was wondering whether we could make this an option.

      I think its counter-intuitive that depending on how you arrived at a fold,
      the text that is shown when you go to insert mode or open the fold is
      different.

      Well, I can see how it might make sense, but I think I'd prefer an option
      or something, so we can change how it works.

      Actually, is it possible (not sure for going to insert mode yet) to have
      commands that open the fold and place the cursor at the top, bottom, (and
      maybe the middle)? So, for example, zo opens the fold and places the cursor
      on the first line, and, say, zl opens the fold and places the cursor on the
      last line.

      Comments?

      Tim
      - Tim
    • Bram Moolenaar
      ... Yet Another Option? I prefer to keep the number of options low. The default behavior should be good enough for most people. Especially options that
      Message 2 of 7 , Aug 4, 2000
      • 0 Attachment
        Tim wrote:

        > In the docs, it says:
        >
        > When moving the cursor downwards, it will move to the first line of a
        > sequence
        > of folded lines. When the cursor is already on a folded line, it
        > moves to the
        > next unfolded line.
        >
        > When moving the cursor upwards, it will
        > move to the last line of a seqyence of
        > folded lines. When the cursor is
        > already on a folded line, it moves to the
        > previous unfolded line.
        >
        > I was wondering whether we could make this an option.

        Yet Another Option? I prefer to keep the number of options low. The default
        behavior should be good enough for most people. Especially options that
        change how a command work can be a problem (e.g., when writing a mapping).

        > I think its counter-intuitive that depending on how you arrived at a fold,
        > the text that is shown when you go to insert mode or open the fold is
        > different.

        It could be changed to always put the cursor on the first line. Do others
        agree that this is the best solution?

        > Actually, is it possible (not sure for going to insert mode yet) to have
        > commands that open the fold and place the cursor at the top, bottom, (and
        > maybe the middle)? So, for example, zo opens the fold and places the cursor
        > on the first line, and, say, zl opens the fold and places the cursor on the
        > last line.

        I don't like to make all kinds of combinations of commands. We quickly run
        out of command names. And the number of commands doubles or triples. I think
        it's better to have separate commands to move to the top, middle (?) and
        bottom of a fold.

        --
        hundred-and-one symptoms of being an internet addict:
        106. When told to "go to your room" you inform your parents that you
        can't...because you were kicked out and banned.

        /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
        \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
      • Michael Geddes
        ... From: Bram Moolenaar [SMTP:Bram@moolenaar.net] It could be changed to always put the cursor on the first line. Do others agree that this is the best
        Message 3 of 7 , Aug 6, 2000
        • 0 Attachment
          -----Original Message-----
          From: Bram Moolenaar [SMTP:Bram@...]

          It could be changed to always put the cursor on the first line. Do
          others
          agree that this is the best solution?

          I'd go along with that. Having it appear on the last line gets annoying.

          //.
        • David Harrison
          ... Yes. I prefer being on the same line of a fold no matter how I got there. --David Jr.
          Message 4 of 7 , Aug 7, 2000
          • 0 Attachment
            On Fri, Aug 04, 2000 at 12:49:44PM +0200, Bram Moolenaar wrote:
            >
            > Tim wrote:
            >
            > > I think its counter-intuitive that depending on how you arrived at a fold,
            > > the text that is shown when you go to insert mode or open the fold is
            > > different.
            >
            > It could be changed to always put the cursor on the first line. Do others
            > agree that this is the best solution?

            Yes. I prefer being on the same "line" of a fold no matter how I got there.

            --David Jr.
          • Bram Moolenaar
            ... I think the rule should be that when you move the cursor into a closed fold, it will be in the first line. But when the cursor was somewhere in a fold and
            Message 5 of 7 , Aug 7, 2000
            • 0 Attachment
              David Harrison wrote:

              > > > I think its counter-intuitive that depending on how you arrived at a fold,
              > > > the text that is shown when you go to insert mode or open the fold is
              > > > different.
              > >
              > > It could be changed to always put the cursor on the first line. Do others
              > > agree that this is the best solution?
              >
              > Yes. I prefer being on the same "line" of a fold no matter how I got there.

              I think the rule should be that when you move the cursor into a closed fold,
              it will be in the first line. But when the cursor was somewhere in a fold and
              you then close it, it should just stay where it is. This will avoid that
              closing and then opening a fold moves the cursor. Agreed?

              --
              hundred-and-one symptoms of being an internet addict:
              164. You got out to buy software, instead of going out for a beer.

              /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
              \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
            • Tim
              I agree with that. I m not sure whether it is particularily beneficial yet to have commands to move front, end, middle(?) within a fold... I think that depends
              Message 6 of 7 , Aug 7, 2000
              • 0 Attachment
                I agree with that.

                I'm not sure whether it is particularily beneficial yet to have commands to
                move front, end, middle(?) within a fold...

                I think that depends on how the folds are used.

                If I used folds on functions, then I think it will be beneficial to be able
                to move to the beginning, end, and middle of the function contents.

                What do you guys think?


                >I think the rule should be that when you move the cursor into a closed fold,
                >it will be in the first line. But when the cursor was somewhere in a fold
                and
                >you then close it, it should just stay where it is. This will avoid that
                >closing and then opening a fold moves the cursor. Agreed?
                >
                >--
                >hundred-and-one symptoms of being an internet addict:
                >164. You got out to buy software, instead of going out for a beer.
                >
                >/// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
                >\\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
                >
                >
                - Tim
              • Nils Lohner
                ... I disagree. 1. I think that when you fold code, the cursor should hop to the beginning of that fold. Then, if you reopen it it should also be at the first
                Message 7 of 7 , Aug 8, 2000
                • 0 Attachment
                  In message <3.0.1.32.20000808015708.00981de0@...>, Tim writes:
                  >>I think the rule should be that when you move the cursor into a closed fold,
                  >>it will be in the first line. But when the cursor was somewhere in a fold
                  >and
                  >>you then close it, it should just stay where it is. This will avoid that
                  >>closing and then opening a fold moves the cursor. Agreed?
                  >>>I agree with that.
                  >
                  >I'm not sure whether it is particularily beneficial yet to have commands to
                  >move front, end, middle(?) within a fold...
                  >
                  >I think that depends on how the folds are used.
                  >
                  >If I used folds on functions, then I think it will be beneficial to be able
                  >to move to the beginning, end, and middle of the function contents.
                  >
                  >What do you guys think?
                  >

                  I disagree.

                  1. I think that when you fold code, the cursor should hop to the beginning
                  of that fold. Then, if you reopen it it should also be at the first line.
                  Think about a 200-line fold- you fold from the middle of it, then you're at
                  the first line (closing must move the cursor to its beginning, else if you
                  fold a large chunk you have no idea where you end up in the rest of the
                  code). If you unfold from there, you don't really want to jump back to the
                  middle of it; that gets confusing. Keep it simple!

                  2. Functions to jump to the beginning, middle and end of a fold are
                  unnecessary IMO. Why? If the folds are limited to scopes, then they are
                  surrounded by parentheses (in C and similar languages at least) and you can
                  just hop to the parentheses. I think adding commands for jumping within
                  folds is superfluous. Now, for languages like python I don't know how
                  scopes would best be determined or jumped to; is there a way for navigating
                  these in vim?
                  Now if you define sections made up of several scopes as one fold (not sure
                  if this is in the planning or not...), then this jumping would be useful as
                  there are no keys to navigate there. If we can indicate the beginning/end
                  of these folds with a character or graphical symbol somehow, maybe we can
                  reuse '%' for these jumps?

                  I hope these arguments make sense... I'm always a proponent of
                  straightforward functionality without a lot of extras to have to think about
                  when performing operations.

                  Regards, Nils.
                Your message has been successfully submitted and would be delivered to recipients shortly.