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

"- register

Expand Messages
  • Marcin Szamotulski
    Dear vim_dev, I have found a strange behaviour of - register, with the following setting: set clipboard=unnamed,autoselect,exclude:cons |linux (unnamed added
    Message 1 of 7 , Nov 23, 2012
    • 0 Attachment
      Dear vim_dev,

      I have found a strange behaviour of "- register, with the following
      setting:

      set clipboard=unnamed,autoselect,exclude:cons\|linux

      (unnamed added at the beginning)

      Let say that I have a file with:

      foo, bar

      Let us try to interchange foo with bar. Use 'de' to delete the 'foo', which
      is placed in the "- register, then I go to "bar" and type '^ve"-p', i.e.
      I try to paste from the visual mode the contents of the "- register and
      nothing happens. Vim overwrites the "- register before the p command is
      executed. If I do '^v<esc>' (go back and forth to the visual mode) the
      "- register is not overwritten. This suggest that the command
      p overwrites "- register before pasting. When there is no 'unnamed' in
      the cb setting this works fine. When 'unnamed' is changed to
      'unnamedplus' it also works fine. I would rather think that "- should
      not be overwritten at all.

      Best regards,
      Marcin

      --
      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
    • Christian Brabandt
      Hi Marcin! ... Interesting. I can t get it to work with the - register at all. regards, Christian -- -- You received this message from the vim_dev maillist.
      Message 2 of 7 , Nov 25, 2012
      • 0 Attachment
        Hi Marcin!

        On Fr, 23 Nov 2012, Marcin Szamotulski wrote:

        > Dear vim_dev,
        >
        > I have found a strange behaviour of "- register, with the following
        > setting:
        >
        > set clipboard=unnamed,autoselect,exclude:cons\|linux
        >
        > (unnamed added at the beginning)
        >
        > Let say that I have a file with:
        >
        > foo, bar
        >
        > Let us try to interchange foo with bar. Use 'de' to delete the 'foo', which
        > is placed in the "- register, then I go to "bar" and type '^ve"-p', i.e.
        > I try to paste from the visual mode the contents of the "- register and
        > nothing happens. Vim overwrites the "- register before the p command is
        > executed. If I do '^v<esc>' (go back and forth to the visual mode) the
        > "- register is not overwritten. This suggest that the command
        > p overwrites "- register before pasting. When there is no 'unnamed' in
        > the cb setting this works fine. When 'unnamed' is changed to
        > 'unnamedplus' it also works fine. I would rather think that "- should
        > not be overwritten at all.

        Interesting. I can't get it to work with the "- register at all.

        regards,
        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
      • Marcin Szamotulski
        ... Hi! Do you confirm the behaviour? I didn t understand your message. Best, Marcin -- You received this message from the vim_dev maillist. Do not top-post!
        Message 3 of 7 , Nov 25, 2012
        • 0 Attachment
          On 14:45 Sun 25 Nov , Christian Brabandt wrote:
          > Hi Marcin!
          >
          > On Fr, 23 Nov 2012, Marcin Szamotulski wrote:
          >
          > > Dear vim_dev,
          > >
          > > I have found a strange behaviour of "- register, with the following
          > > setting:
          > >
          > > set clipboard=unnamed,autoselect,exclude:cons\|linux
          > >
          > > (unnamed added at the beginning)
          > >
          > > Let say that I have a file with:
          > >
          > > foo, bar
          > >
          > > Let us try to interchange foo with bar. Use 'de' to delete the 'foo', which
          > > is placed in the "- register, then I go to "bar" and type '^ve"-p', i.e.
          > > I try to paste from the visual mode the contents of the "- register and
          > > nothing happens. Vim overwrites the "- register before the p command is
          > > executed. If I do '^v<esc>' (go back and forth to the visual mode) the
          > > "- register is not overwritten. This suggest that the command
          > > p overwrites "- register before pasting. When there is no 'unnamed' in
          > > the cb setting this works fine. When 'unnamed' is changed to
          > > 'unnamedplus' it also works fine. I would rather think that "- should
          > > not be overwritten at all.
          >
          > Interesting. I can't get it to work with the "- register at all.
          >
          > regards,
          > 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

          Hi!

          Do you confirm the behaviour? I didn't understand your message.

          Best,
          Marcin

          --
          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
        • Christian Brabandt
          ... Whatever I do, Vim always overwrite the - register. I didn t see any difference with or without setting cb , Vim always overwrites the small delete
          Message 4 of 7 , Nov 26, 2012
          • 0 Attachment
            On Sun, November 25, 2012 15:14, Marcin Szamotulski wrote:
            > Do you confirm the behaviour? I didn't understand your message.

            Whatever I do, Vim always overwrite the - register. I didn't see any
            difference with or without setting 'cb', Vim always overwrites the
            small delete register and puts that newly yanked part.

            regards,
            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
          • Marcin Szamotulski
            ... You are right, sorry for the fuss. Cheers, Marcin -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text
            Message 5 of 7 , Nov 26, 2012
            • 0 Attachment
              On 10:24 Mon 26 Nov , Christian Brabandt wrote:
              > On Sun, November 25, 2012 15:14, Marcin Szamotulski wrote:
              > > Do you confirm the behaviour? I didn't understand your message.
              >
              > Whatever I do, Vim always overwrite the - register. I didn't see any
              > difference with or without setting 'cb', Vim always overwrites the
              > small delete register and puts that newly yanked part.
              >
              > regards,
              > 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

              You are right, sorry for the fuss.

              Cheers,
              Marcin

              --
              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
            • Christian Brabandt
              Hi Marcin! ... Here is a small patch and test: diff --git a/src/normal.c b/src/normal.c ... +++ b/src/normal.c @@ -9410,7 +9410,8 @@ # ifdef FEAT_CLIPBOARD
              Message 6 of 7 , Nov 28, 2012
              • 0 Attachment
                Hi Marcin!

                On Mo, 26 Nov 2012, Marcin Szamotulski wrote:

                > On 10:24 Mon 26 Nov , Christian Brabandt wrote:
                > > Whatever I do, Vim always overwrite the - register. I didn't see any
                > > difference with or without setting 'cb', Vim always overwrites the
                > > small delete register and puts that newly yanked part.

                Here is a small patch and test:

                diff --git a/src/normal.c b/src/normal.c
                --- a/src/normal.c
                +++ b/src/normal.c
                @@ -9410,7 +9410,8 @@
                # ifdef FEAT_CLIPBOARD
                adjust_clip_reg(®name);
                # endif
                - if (regname == 0 || regname == '"' || VIM_ISDIGIT(regname)
                + if (regname == 0 || regname == '"'
                + || VIM_ISDIGIT(regname) || regname == '-'
                # ifdef FEAT_CLIPBOARD
                || (clip_unnamed && (regname == '*' || regname == '+'))
                # endif
                diff --git a/src/testdir/test48.in b/src/testdir/test48.in
                --- a/src/testdir/test48.in
                +++ b/src/testdir/test48.in
                @@ -54,8 +54,12 @@
                ^Oi^Ei^Ei^E <-- should show the name of a noted text editor
                ^oi^Yi^Yi^Y <-- and its version numberdd
                :"
                +:" Test for yanking and pasting using the small delete register
                +gg/^foo
                +dewve"-p
                :wq! test.out
                ENDTEST
                +foo, bar
                keyword keyw
                all your base are belong to us
                1 2 3 4 5 6
                diff --git a/src/testdir/test48.ok b/src/testdir/test48.ok
                --- a/src/testdir/test48.ok
                +++ b/src/testdir/test48.ok
                @@ -1,3 +1,4 @@
                +, foo
                keyword keyword
                all your base
                are belong to vim


                regards,
                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
              • Marcin Szamotulski
                ... The patch works fine for me. Thanks a lot! Marcin -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the
                Message 7 of 7 , Nov 29, 2012
                • 0 Attachment
                  On 28 November 2012 18:27, Christian Brabandt <cblists@...> wrote:
                  Hi Marcin!

                  On Mo, 26 Nov 2012, Marcin Szamotulski wrote:

                  > On 10:24 Mon 26 Nov     , Christian Brabandt wrote:
                  > > Whatever I do, Vim always overwrite the - register. I didn't see any
                  > > difference with or without setting 'cb', Vim always overwrites the
                  > > small delete register and puts that newly yanked part.

                  Here is a small patch and test:

                  diff --git a/src/normal.c b/src/normal.c
                  --- a/src/normal.c
                  +++ b/src/normal.c
                  @@ -9410,7 +9410,8 @@
                   # ifdef FEAT_CLIPBOARD
                              adjust_clip_reg(&regname);
                   # endif
                  -           if (regname == 0 || regname == '"' || VIM_ISDIGIT(regname)
                  +           if (regname == 0 || regname == '"'
                  +                   || VIM_ISDIGIT(regname) || regname == '-'
                   # ifdef FEAT_CLIPBOARD
                                      || (clip_unnamed && (regname == '*' || regname == '+'))
                   # endif
                  diff --git a/src/testdir/test48.in b/src/testdir/test48.in
                  --- a/src/testdir/test48.in
                  +++ b/src/testdir/test48.in
                  @@ -54,8 +54,12 @@
                   ^Oi^Ei^Ei^E   <-- should show the name of a noted text editor
                   ^oi^Yi^Yi^Y   <-- and its version numberdd
                   :"
                  +:" Test for yanking and pasting using the small delete register
                  +gg/^foo
                  +dewve"-p
                   :wq! test.out
                   ENDTEST
                  +foo, bar
                   keyword keyw
                   all your base are belong to us
                   1 2 3 4 5 6
                  diff --git a/src/testdir/test48.ok b/src/testdir/test48.ok
                  --- a/src/testdir/test48.ok
                  +++ b/src/testdir/test48.ok
                  @@ -1,3 +1,4 @@
                  +, foo
                   keyword keyword
                   all your base
                   are belong to vim


                  regards,
                  Christian



                  The patch works fine for me.  Thanks a lot!

                  Marcin

                  --
                  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
                Your message has been successfully submitted and would be delivered to recipients shortly.