vim / vim

The official Vim repository
https://www.vim.org
Vim License
36.77k stars 5.47k forks source link

:yank does not act with yank #10891

Open yyy33 opened 2 years ago

yyy33 commented 2 years ago

Steps to reproduce

  1. start vim
  2. set option set clipboard=unnamedplus
  3. Suppose the following two lines of text are in the current buffer
    111
    222
    333
  4. Jump to the first line and type yy
  5. Jump to the second line and type ""yy
  6. At this time, the content of the + register is 111, and the content of the "register is 222.
  7. Jump to the third line and execute the command:yank "
  8. Now, the contents of both the + register and the "register become 333

Expected behaviour

The contents of the + register should not be modified during the execution of the :yank " command

Version of Vim

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug 02 2022 21:22:22)

Environment

Operating system/version : Arch linux Terminal name/version :alacritty 0.10.1 () $TERM environment variable : xterm-256color Shell : zsh

Logs and stack traces

No response

chrisbra commented 2 years ago

I think Vim sees the " as comment char, so please try escaping the ", e.g.:

:yank \"
chrisbra commented 2 years ago

no reaction? Can I assume this works for you?

yyy33 commented 2 years ago

no reaction? Can I assume this works for you?

:~

no reaction? Can I assume this works for you?

Sorry for the late reply, I finished executing :yank \", "The contents of the " register and + register are not changed And I execute ""yy in normal mode, the contents of those two registers are not changed either, there is something strange