]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy.el
ivy.el (ivy-occur-press): Set counsel-grep-last-line to nil
[gnu-emacs-elpa] / ivy.el
diff --git a/ivy.el b/ivy.el
index 22deab9a5d3298ef0725480a5b46149af01e7034..674e487f92b3e6d62fbaeb77b5ff3ca225a74e2c 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1400,11 +1400,11 @@ This is useful for recursive `ivy-read'."
                                 :test #'equal)))
                (setq coll (all-completions "" collection predicate))))
             ((eq collection 'read-file-name-internal)
-             (setq ivy--directory
-                   (if (file-directory-p initial-input)
-                       (prog1 initial-input
-                         (setq initial-input nil))
-                     default-directory))
+             (if (and initial-input (file-directory-p initial-input))
+                 (progn
+                   (setq ivy--directory initial-input)
+                   (setq initial-input nil))
+               (setq ivy--directory default-directory))
              (require 'dired)
              (when preselect
                (let ((preselect-directory (file-name-directory preselect)))
@@ -2994,6 +2994,7 @@ EVENT gives the mouse position."
 (declare-function swiper--cleanup "swiper")
 (declare-function swiper--add-overlays "swiper")
 (defvar ivy-occur-timer nil)
+(defvar counsel-grep-last-line)
 
 (defun ivy-occur-press ()
   "Execute action for the current candidate."
@@ -3020,6 +3021,7 @@ EVENT gives the mouse position."
            (action (ivy--get-action ivy-last))
            (ivy-exit 'done))
       (with-ivy-window
+        (setq counsel-grep-last-line nil)
         (funcall action
                  (if (and (consp coll)
                           (consp (car coll)))