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

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

[elpa] master 77e7c8f 24/90: Account for minibuffer-depth-indication-mod


From: Oleh Krehel
Subject: [elpa] master 77e7c8f 24/90: Account for minibuffer-depth-indication-mode
Date: Tue, 30 Jun 2015 07:28:11 +0000

branch: master
commit 77e7c8f86f868296824eff7b142dc51fa9b38dbf
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Account for minibuffer-depth-indication-mode
    
    * ivy.el (ivy--insert-prompt): When `minibuffer-depth-indication-mode'
      is on, and `minibuffer-depth' is more than 1, prepend it to prompt.
    
    Fixes #134
---
 ivy.el |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ivy.el b/ivy.el
index 83857c2..f4ff270 100644
--- a/ivy.el
+++ b/ivy.el
@@ -959,7 +959,7 @@ Everything after \"!\" should not match."
   "Update the prompt according to `ivy--prompt'."
   (when ivy--prompt
     (unless (memq this-command '(ivy-done ivy-alt-done ivy-partial-or-done
-                                          counsel-find-symbol))
+                                 counsel-find-symbol))
       (setq ivy--prompt-extra ""))
     (let (head tail)
       (if (string-match "\\(.*\\): \\'" ivy--prompt)
@@ -972,12 +972,17 @@ Everything after \"!\" should not match."
             (std-props '(front-sticky t rear-nonsticky t field t read-only t))
             (n-str
              (format
-              (concat head
-                      ivy--prompt-extra
-                      tail
-                      (if ivy--directory
-                          (abbreviate-file-name ivy--directory)
-                        ""))
+              (concat
+               (if (and (bound-and-true-p minibuffer-depth-indicate-mode)
+                        (> (minibuffer-depth) 1))
+                   (format "[%d] " (minibuffer-depth))
+                 "")
+               head
+               ivy--prompt-extra
+               tail
+               (if ivy--directory
+                   (abbreviate-file-name ivy--directory)
+                 ""))
               (or (and (ivy-state-dynamic-collection ivy-last)
                        ivy--full-length)
                   ivy--length))))



reply via email to

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