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

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

[elpa] externals/ivy-explorer 783816a 25/25: Fixes #2


From: Stefan Monnier
Subject: [elpa] externals/ivy-explorer 783816a 25/25: Fixes #2
Date: Tue, 8 Jan 2019 12:26:00 -0500 (EST)

branch: externals/ivy-explorer
commit 783816afda31d1b75487b906257e23e273bad6fa
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Fixes #2
---
 ivy-explorer.el | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/ivy-explorer.el b/ivy-explorer.el
index ba989c9..033ca4d 100644
--- a/ivy-explorer.el
+++ b/ivy-explorer.el
@@ -322,14 +322,16 @@ If called from code ACTION is the action to trigger 
afterwards."
 (defun ivy-explorer-next (arg)
   "Move cursor vertically down ARG candidates."
   (interactive "p")
-  (let* ((n (* arg ivy-explorer--col-n))
-         (max (1- ivy--length))
-         (colmax (- max (% (- max ivy--index) n))))
-    (ivy-set-index
-     (if (= ivy--index -1)
-         0
-       (min colmax
-            (+ ivy--index n))))))
+  (if (> (minibuffer-depth) 1)
+      (call-interactively 'ivy-next-line)
+    (let* ((n (* arg ivy-explorer--col-n))
+           (max (1- ivy--length))
+           (colmax (- max (% (- max ivy--index) n))))
+      (ivy-set-index
+       (if (= ivy--index -1)
+           0
+         (min colmax
+              (+ ivy--index n)))))))
 
 (defun ivy-explorer-next-and-call (arg)
   "Move cursor down ARG candidates.
@@ -342,14 +344,16 @@ Call the permanent action if possible."
 (defun ivy-explorer-previous (arg)
   "Move cursor vertically up ARG candidates."
   (interactive "p")
-  (let* ((n (* arg ivy-explorer--col-n))
-         (colmin (% ivy--index n)))
-    (ivy-set-index
-     (if (and (= ivy--index 0)
-              ivy-use-selectable-prompt)
-         -1
-       (max colmin
-            (- ivy--index n))))))
+  (if (> (minibuffer-depth) 1)
+      (call-interactively 'ivy-previous-line)
+    (let* ((n (* arg ivy-explorer--col-n))
+           (colmin (% ivy--index n)))
+      (ivy-set-index
+       (if (and (= ivy--index 0)
+                ivy-use-selectable-prompt)
+           -1
+         (max colmin
+              (- ivy--index n)))))))
 
 (defun ivy-explorer-previous-and-call (arg)
   "Move cursor up ARG candidates.



reply via email to

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