emacs-diffs
[Top][All Lists]
Advanced

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

scratch/icomplete-vertical-mode-improvements 9225cf0 1/2: When icomplete


From: João Távora
Subject: scratch/icomplete-vertical-mode-improvements 9225cf0 1/2: When icomplete-scroll show number of completions
Date: Fri, 28 May 2021 06:55:12 -0400 (EDT)

branch: scratch/icomplete-vertical-mode-improvements
commit 9225cf08a6eb2ae531775703d677fdebe29c3baf
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    When icomplete-scroll show number of completions
    
    * lisp/icomplete.el:
    (icomplete--last-selected, icomplete--comp-predecessors): Remove.
    (icomplete--scrolled-past, icomplete--scrolled-completions): New variables.
    (icomplete-forward-completions)
    (icomplete-backward-completions)
    (icomplete-minibuffer-setup):  Simplify.
    (icomplete-exhibit): Use new variable name.
    (icomplete--render-vertical): Simplify.
    (icomplete-exhibit):
---
 lisp/icomplete.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index befcae5..8ed4111 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -690,11 +690,18 @@ See `icomplete-mode' and `minibuffer-setup-hook'."
                  deactivate-mark)
             ;; Do nothing if while-no-input was aborted.
             (when (stringp text)
-              (move-overlay icomplete-overlay (point) (point) (current-buffer))
+              (move-overlay icomplete-overlay (point-min) (point) 
(current-buffer))
               ;; The current C cursor code doesn't know to use the overlay's
               ;; marker's stickiness to figure out whether to place the cursor
               ;; before or after the string, so let's spoon-feed it the pos.
               (put-text-property 0 1 'cursor t text)
+              (when icomplete-scroll
+                (let ((past (length icomplete--scrolled-past)))
+                  (overlay-put icomplete-overlay 'before-string
+                               (format "%s/%s "
+                                       (1+ past)
+                                       (+ past
+                                          (safe-length 
completion-all-sorted-completions))))))
               (overlay-put icomplete-overlay 'after-string text))))))))
 
 (defun icomplete--affixate (md prospects)



reply via email to

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