]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy.el
ivy.el: Improve "M-n"
[gnu-emacs-elpa] / ivy.el
diff --git a/ivy.el b/ivy.el
index b5b8f868281961383f1e13c4cfee824433d2c555..86021d61710dfe0ec320065ab366bb6728db0921 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -305,7 +305,8 @@ This should eventually become a stack so that you could use
   "Return a string that corresponds to the current thing at point."
   (or
    (thing-at-point 'url)
-   (ffap-file-at-point)
+   (and (eq (ivy-state-collection ivy-last) 'read-file-name-internal)
+        (ffap-file-at-point))
    (let (s)
      (cond ((stringp (setq s (thing-at-point 'symbol)))
             (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
@@ -1283,9 +1284,7 @@ customizations apply to the current completion session."
         (transformer-fn
          (plist-get ivy--display-transformers-list
                     (or caller (and (functionp collection)
-                                    collection))))
-        (original-action (and (consp action)
-                              (copy-sequence action))))
+                                    collection)))))
     (setq ivy-last
           (make-ivy-state
            :prompt prompt
@@ -1341,8 +1340,6 @@ customizations apply to the current completion session."
             (when recursive-ivy-last
               (ivy--reset-state (setq ivy-last recursive-ivy-last)))))
       (ivy-call)
-      (when original-action
-        (setf (ivy-state-action ivy-last) original-action))
       (when (and recursive-ivy-last
                  ivy-recursive-restore)
         (ivy--reset-state (setq ivy-last recursive-ivy-last))))))