]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-completion-in-region): Fix for 1 cand
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 8 Jan 2016 12:47:11 +0000 (13:47 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 8 Jan 2016 12:47:11 +0000 (13:47 +0100)
Set `ivy-state-window' properly.

ivy.el

diff --git a/ivy.el b/ivy.el
index b730f78ac84d03d89b940f068330af897c35e52e..3e93d762fab0a2c443bbae455c55df8f78713499 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1404,7 +1404,11 @@ The previous string is between `ivy-completion-beg' and `ivy-completion-end'."
       (setq ivy-completion-beg (- end (ivy-completion-common-length (car comps))))
       (setq ivy-completion-end end)
       (if (null (cdr comps))
-          (ivy-completion-in-region-action (car comps))
+          (progn
+            (setf (ivy-state-window ivy-last) (selected-window))
+            (ivy-completion-in-region-action
+             (substring-no-properties
+              (car comps))))
         (let* ((w (1+ (floor (log (length comps) 10))))
                (ivy-count-format (and ivy-count-format
                                       (format "%%-%dd " w))))