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

14214Re: Visual block insert problem when using left arrow in the insert mode.

Expand Messages
  • Bram Moolenaar
    Aug 13, 2014
    • 0 Attachment
      Christian Brabandt wrote:

      > On So, 10 Aug 2014, Bram Moolenaar wrote:
      >
      > > Aleksandar Ivanov wrote:
      > >
      > > > Hi, I have a weird problem which I have no idea how to debug. I am using version 7.4.398
      > > >
      > > > Let's say that I have a file with such content:
      > > >
      > > > aaaaaaaaaaaa
      > > > bbbbbbbbbbb
      > > > ccccccccccccc
      > > >
      > > > Then I am selecting the start of the three lines in visual block and
      > > > starting to insert
      > > >
      > > > ^ C-v jj I
      > > >
      > > > I insert '<' then '>' then click the left arrow and insert 'p' then I
      > > > press esc. The result I got is
      >
      > You were using the mouse to move the cursor?
      >
      > > > <p>aaaaaaaaaaaa
      > > > bp>abbbbbbbbbb
      > > > cp>acccccccccccc
      > > >
      > > > I could use only letters and it brakes again. That is 'a' then 'b'
      > > > then left arrow then 'c'.
      > > > If I write it in one go '<' then 'p' then '>', it works correctly. So
      > > > it should be something with the left arrow key.
      > > >
      > > Christian Brabandt tried to make this work, e.g. with patch 7.4.085.
      > > Apparently there still is a situation where the start of the insert
      > > isn't remembered properly.
      >
      > I think, I have fixed the issue. The problem is, that the determination
      > of where insert mode originally starts is a little bit complex. That's
      > what I called "fragile" when I originally posted patch 7.4.085.
      > Please try the attached patch.
      >
      > That should stop Vim from marking the position after using the arrow
      > keys as where insertion started originally.

      Thanks. Yes, it's a bit complex. Would there be a less complex way?
      It is perhaps possible to always keep the original insert point
      (separately from the current one) and then later figure out if we can
      use it, instead of trying to disable it in some situations. Or perhaps
      keep the lowest column of where something was inserted, but only if it's
      still the same lnum.

      --
      How To Keep A Healthy Level Of Insanity:
      5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten
      over their caffeine addictions, switch to espresso.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_mac" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Show all 5 messages in this topic