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

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

[elpa] master bfddbc2 199/348: ivy-overlay.el (ivy-display-function-over


From: Oleh Krehel
Subject: [elpa] master bfddbc2 199/348: ivy-overlay.el (ivy-display-function-overlay): Fix up
Date: Sat, 8 Apr 2017 11:03:56 -0400 (EDT)

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

    ivy-overlay.el (ivy-display-function-overlay): Fix up
    
    Don't call `ivy-left-pad' with a negative arg.
    
    This change should theoretically enable you to:
    
        (setq ivy-display-function 'ivy-display-function-overlay)
    
    Note that this isn't recommended: things go crazy for `swiper' etc.
    `'ivy-display-function-overlay' is best used only for in-line
    completion (e.g. `complete-symbol').
    
    Fixes #707
---
 ivy-overlay.el | 5 ++++-
 ivy.el         | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ivy-overlay.el b/ivy-overlay.el
index a4eae2e..2020d08 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -85,7 +85,10 @@ Hide the minibuffer contents and cursor."
                (+ (if (eq major-mode 'org-mode)
                       (* org-indent-indentation-per-level (org-current-level))
                     0)
-                  (- ivy-completion-beg ivy-completion-end)
+                  (if (eq (ivy-state-caller ivy-last)
+                          'ivy-completion-in-region)
+                      (- ivy-completion-beg ivy-completion-end)
+                    0)
                   (current-column))))))
         (add-face-text-property cursor-pos (1+ cursor-pos)
                                 'ivy-cursor t overlay-str)
diff --git a/ivy.el b/ivy.el
index 093c5e8..6a65ad7 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1460,6 +1460,7 @@ customizations apply to the current completion session."
                                                (cdr (symbol-value hist))))))))
                  ivy--current))
           (remove-hook 'post-command-hook #'ivy--exhibit)
+          (ivy-overlay-cleanup)
           (when (setq unwind (ivy-state-unwind ivy-last))
             (funcall unwind))
           (unless (eq ivy-exit 'done)



reply via email to

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