Issue #283 resolved

evil-paste-pop does not replace if visual selection is overridden.

johannes_g
created an issue

The proclaimed behavior of evil-paste-pop "Replace the just-yanked stretch of killed text with a different stretch."

But it does not:

If I select a word (e.g. with 'viw') , then press 'P' (yank), it gets replaced. If I want to replace the just yanked text using 'C-P' it does not replace it, but instead simply insert at the beginning of the just janked text.

(I hope the description helps).

Version info:

  • (evil-version) -> Evil version 1.0-dev

  • ELPA says: Version: 20130325.2034

  • Emacs: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4) of 2013-03-18 on eric

  • Tested both X and terminal version in a clean install.

Comments (5)

  1. Frank Fischer repo owner

    Support paste-pop after visual paste (fix #283)

    In contrast to a normal paste, a visual paste deletes some text before pasting (and puts it on the kill-ring). Because evil-paste-pop first undos the last operation (i.e. the paste), the original text is restored, so the repeated paste must be executed as 'visual paste', too, with the original visual region restored, so that the new paste operation will again delete the original text. Furthermore, the first visual paste (and only the first) adds the replaced text to the kill ring, so the paste-pop must take care of this situation and skip that text appropriately. The information that the previous paste was the first visual paste (and thus modified the kill-ring) is saved as 6th value in the evil-last-paste variable.

    → <<cset 7b1750a15982>>

  2. Frank Fischer repo owner

    Support paste-pop after visual paste (fix #283)

    In contrast to a normal paste, a visual paste deletes some text before pasting (and puts it on the kill-ring). Because evil-paste-pop first undos the last operation (i.e. the paste), the original text is restored, so the repeated paste must be executed as 'visual paste', too, with the original visual region restored, so that the new paste operation will again delete the original text. Furthermore, the first visual paste (and only the first) adds the replaced text to the kill ring, so the paste-pop must take care of this situation and skip that text appropriately. The information that the previous paste was the first visual paste (and thus modified the kill-ring) is saved as 6th value in the evil-last-paste variable.

    → <<cset 7b1750a15982>>

  3. Log in to comment