emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 28cb795 53/57: Don't try to call permanent action if there


From: Oleh Krehel
Subject: [elpa] master 28cb795 53/57: Don't try to call permanent action if there's none
Date: Tue, 19 May 2015 14:21:41 +0000

branch: master
commit 28cb79553506c3f01313bc21c66dc33045d3b982
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Don't try to call permanent action if there's none
    
    * ivy.el (ivy-next-line-and-call): Update.
    (ivy-previous-line-and-call): Update.
    
    Fixes #114.
---
 ivy.el |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/ivy.el b/ivy.el
index 8f68bc7..9870032 100644
--- a/ivy.el
+++ b/ivy.el
@@ -416,20 +416,24 @@ If the input is empty, select the previous history 
element instead."
   (ivy-previous-line arg))
 
 (defun ivy-next-line-and-call (&optional arg)
-  "Move cursor vertically down ARG candidates."
+  "Move cursor vertically down ARG candidates.
+Call the permanent action if possible."
   (interactive "p")
   (ivy-next-line arg)
   (ivy--exhibit)
-  (with-selected-window (ivy-state-window ivy-last)
-    (funcall (ivy-state-action ivy-last))))
+  (when (ivy-state-action ivy-last)
+    (with-selected-window (ivy-state-window ivy-last)
+      (funcall (ivy-state-action ivy-last)))))
 
 (defun ivy-previous-line-and-call (&optional arg)
-  "Move cursor vertically down ARG candidates."
+  "Move cursor vertically down ARG candidates.
+Call the permanent action if possible."
   (interactive "p")
   (ivy-previous-line arg)
   (ivy--exhibit)
-  (with-selected-window (ivy-state-window ivy-last)
-    (funcall (ivy-state-action ivy-last))))
+  (when (ivy-state-action ivy-last)
+    (with-selected-window (ivy-state-window ivy-last)
+      (funcall (ivy-state-action ivy-last)))))
 
 (defun ivy-previous-history-element (arg)
   "Forward to `previous-history-element' with ARG."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]