Issue #193 resolved

yanking into register (without mark) not working

Anonymous created an issue

Yanking //n// lines of text into a register without first setting a mark does not work - the register is left empty.

Version of evil used: 0.1 / latest from git

Steps to reproduce: 1) In scratch buffer, create five lines of text: Line 1 Line 2 Line 3 Line 4 Line 5

2) Set cursor / point at Line 1 3) Yank three lines of text to register 'a': "a3Y 4) Paste from register 'a': "ap 5) Emacs mini-buffer/status-bar says "Register 'a' is empty"

If I set a mark first, then yank from the mark to the cursor/point, this works correctly. If I use visual mode, this works correctly. If I yank a single line to a register, this works correctly as well.

I was able to get evil to keep the contents of the register by commenting out line 56 and 57 of function 'evil-normal-post-command' in 'evil-states.el', where 'evil-this-register' was being set to nil. I imagine this is probably not the right thing to do.

For what it's worth, in vim v7.3, performing a "a3Y results in the status bar saying "3 lines yanked"

Comments (1)

  1. Frank Fischer repo owner

    Ensure prefix-commands do not clear `evil-this-register'

    Prefix commands like digit-argument' should not influence the register specified for the follow command. This is because both, prefix commands and the register commandevil-use-register', are not full editing commands on their own put used to modify the following "real" command.

    This closes issue #196. This closes issue #193.

    → <<cset c5d9f61d1ee4>>

  2. Log in to comment