]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix yank/undo bug
authorOleh Krehel <ohwoeowho@gmail.com>
Mon, 15 Jun 2015 09:59:22 +0000 (11:59 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 15 Jun 2015 09:59:22 +0000 (11:59 +0200)
* ivy.el (ivy--insert-minibuffer): Bind `buffer-undo-list' later.
Previously, "C-y C-u" would result in the first char of yanked text not
being undone.

ivy.el

diff --git a/ivy.el b/ivy.el
index c4ff81419286bbbc17815199b9120c335d4b7016..4e646d0c7f7e4f767f7b4ef266e541df47947443 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1105,7 +1105,6 @@ Should be run via minibuffer `post-command-hook'."
 (defun ivy--insert-minibuffer (text)
   "Insert TEXT into minibuffer with appropriate cleanup."
   (let ((resize-mini-windows nil)
-        (buffer-undo-list t)
         (update-fn (ivy-state-update-fn ivy-last))
         deactivate-mark)
     (ivy--cleanup)
@@ -1114,9 +1113,10 @@ Should be run via minibuffer `post-command-hook'."
     (ivy--insert-prompt)
     ;; Do nothing if while-no-input was aborted.
     (when (stringp text)
-      (save-excursion
-        (forward-line 1)
-        (insert text)))))
+      (let ((buffer-undo-list t))
+        (save-excursion
+          (forward-line 1)
+          (insert text))))))
 
 (declare-function colir-blend-face-background "ext:colir")