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

67652Re: gp vs p

Expand Messages
  • Christian Brabandt
    Jan 4, 2013
      Hi Axel!

      On Fr, 04 Jan 2013, Axel Bender wrote:

      > I'm wondering if the behavior of normal mode "p" is correct in respect to the cursor position?
      >
      > The docs state for "gp":
      >
      > "Just like "p", but leave the cursor just after the new text."
      >
      > which suggests/implies that after "p" the cursor should stay in its current position (which - unfortunately - is not the case).

      Well, the cursor positioning seems rather complicated for p and P, see
      the description of the standard:
      http://pubs.opengroup.org/onlinepubs/9699919799/
      (and search for Put from Buffer Following and Put from Buffer Before).

      However, when reading this section:

      ,----[ Put from Buffer Following ]-
      | Synopsis:
      | [buffer] p
      |
      | […]
      | Current column:
      |
      | If the buffer text is in character mode:
      |
      | If the text in the buffer is from more than a single line, then set to
      | the last column on which any portion of the first character from the
      | buffer is displayed.
      |
      | Otherwise, if the buffer is the unnamed buffer, set to the last column
      | on which any portion of the last character from the buffer is displayed.
      |
      | Otherwise, set to the first column on which any portion of the first
      | character from the buffer is displayed.
      `----

      Reading the last sentence, it seems to me, that Vim does not behave like
      this, in fact, 'p' for character mode always seems to move to the last
      inserted character. This sounds like a bug to me? (nvi behaves as
      documented). Should this be fixed (and possibly added yet-another flag
      to the 'cpo' setting)?

      Mit freundlichen Grüßen
      Christian
      --

      --
      You received this message from the "vim_dev" 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
    • Show all 7 messages in this topic