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

Re: Visual block behavior

Expand Messages
  • Bram Moolenaar
    ... Yes, there are situations where the extra spaces are useful. We could discuss in how many situations it is and in how many situations it isn t, but that s
    Message 1 of 13 , Nov 29, 2000
    • 0 Attachment
      Mark Waggoner wrote:

      > > Well, it depends on how you look at this. If you yank a block, where some
      > > of the lines are too short, what are you yanking anyway? The missing
      > > characters are somewhat special. If you insert the block in front of
      > > other text, you want to keep the width of the block and insert spaces to
      > > do that. But if there are no characters after the block, why insert extra
      > > spaces? There is nothing to align there.
      >
      > There is nothing to align _yet_. You might want to add something to
      > the lines after the fact.

      Yes, there are situations where the extra spaces are useful. We could
      discuss in how many situations it is and in how many situations it isn't, but
      that's not very useful. If it's 50% we still don't know what to do. I prefer
      not to add spaces, so that's how it is now.

      > > If you want the extra spaces, you will have to put them there with some
      > > command.
      >
      > What (vim) command is there to add spaces to every line to fill out to
      > a particular column? I know how to remove them (:1,$s/ \+$//), but I
      > don't know how to add them.

      There are several ways, depending on what you are doing. But there is no
      simple command to say "make all lines the same lenght, pad with spaces". At
      least I can't think of it right now. What I would do now is add lots of
      spaces to each line and delete the ones that are too much. When you are
      editing a table it's often easier to yank a block of the right hight and put
      it at the end. (all this is a lot easier when virtual editing is enabled).

      > > I don't think putting a block should have this side effect, even
      > > though it might be useful in some situations.
      >
      > Why not? If you are doing a "block" select (Ctrl-V) it make sense to
      > have it end up being a true block when pasted somewhere else. If you
      > don't want a rectangular block, don't select a rectangular block. Use
      > 'V' or 'v' instead.

      The point I mentioned previously applies: You yanked a block with some
      non-existing characters. When you put the block somewhere else, do you want
      the non-existing characters to be replaced by spaces or not? You can't use v
      or V, you would get a completely different text.

      --
      FATHER: Did you kill all those guards?
      LAUNCELOT: Yes ... I'm very sorry ...
      FATHER: They cost fifty pounds each!
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// 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.