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

RE: Patch 5.6.075

Expand Messages
  • Mike Steed
    Hi, This patch makes the inserted text appear as one would expect it to appear, but the indentation is not done as I would expect. The original test case was
    Message 1 of 3 , Jun 2, 2000
    • 0 Attachment
      Hi,

      This patch makes the inserted text appear as one would expect it to
      appear, but the indentation is not done as I would expect. The original
      test case was something like this:

      gvim -u NONE -U NONE
      :set sts=4

      Insert the following three lines:

      abcd
      abcd
      abcd

      (four spaces at the start of each line).

      Then with the cursor on the first 'a', do ^Vjj to select the first letter in
      each row. Then hit

      I<Tab>12345<Esc>

      The text appears as

      12345abcd
      12345abcd
      12345abcd

      which looks correct. Then :set list, and you see

      ^I12345abcd$
      ^I12345abcd$
      ^I12345abcd$

      Shouldn't the second and third lines be identical to the first line? That
      is, shouldn't they contain a tab and no spaces?

      This is a minor thing, but if it is just as easy to do it this way, I would
      like to see it changed.

      Thanks,
      Mike.

      > From: Bram Moolenaar [mailto:Bram@...]
      > Sent: Friday, June 02, 2000 12:14 PM
      > To: vim-dev@...
      > Subject: Patch 5.6.075
      >
      >
      >
      > Patch 5.6.075
      > Problem: When using "I" or "A" in Visual block mode while 'sts' is set
      may
      > change spaces to a Tab the inserted text is not correct. (Mike
      > Steed) And some other problems when using "A" to append after
      the
      > end of the line.
      > Solution: Check for change in spaces/tabs after inserting the text.
      Append
      > spaces to fill the gap between the end-of-line and the right
      edge
      > of the block.

      [patch snipped]

      > /-/-- Bram Moolenaar --- Bram@... ---
      http://www.moolenaar.net --\-\
      \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf
      --/-/
    • Bram Moolenaar
      ... Yes, the spaces in the second and third lines should have been removed. Unfortunately, this is a bit difficult to add to the existing code. I might want
      Message 2 of 3 , Jun 3, 2000
      • 0 Attachment
        Mike Steed wrote:

        > which looks correct. Then :set list, and you see
        >
        > ^I12345abcd$
        > ^I12345abcd$
        > ^I12345abcd$
        >
        > Shouldn't the second and third lines be identical to the first line? That
        > is, shouldn't they contain a tab and no spaces?

        Yes, the spaces in the second and third lines should have been removed.
        Unfortunately, this is a bit difficult to add to the existing code. I might
        want to completely change the way it works. Currently it remembers some
        positions, gives the user control to enter the text, then grabs the entered
        text and repeats it in the other lines. Thus the text is not entered "as
        typed" in the other lines, but copied from the first line. It would be better
        if the typed characters are repeated in each line. But that may cause other
        problems, this requires investigation. I don't plan to do that soon though...

        --
        This message contains 78% recycled characters.

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