[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/icomplete-vertical-mode-improvements f751980 05/10: Don't break
From: |
João Távora |
Subject: |
scratch/icomplete-vertical-mode-improvements f751980 05/10: Don't break icomplete-vertical-mode scrolling when moving non-destructively |
Date: |
Fri, 28 May 2021 06:10:05 -0400 (EDT) |
branch: scratch/icomplete-vertical-mode-improvements
commit f751980652f6df3ddd7b4c8e5ee3090e57abbfb9
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Don't break icomplete-vertical-mode scrolling when moving non-destructively
* lisp/icomplete.el (icomplete--render-vertical): Rework.
---
lisp/icomplete.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 82be6ea..4c651e2 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -696,13 +696,15 @@ See `icomplete-mode' and `minibuffer-setup-hook'."
(overlay-put icomplete-overlay 'after-string text))))))))
(defun icomplete--render-vertical (comps)
- ;; First attempt to keep selection stable.
+ ;; First attempt to keep selection stable. Do this only if the
+ ;; selection didn't change but the candidates did.
(when (and icomplete--last-selected
+ (not (eq (cdr icomplete--last-selected) (buffer-modified-tick)))
(null icomplete-rotate))
(cl-loop
with preds
for (comp . rest) on comps
- when (equal comp icomplete--last-selected)
+ when (equal comp (car icomplete--last-selected))
do
(setq icomplete--comp-predecessors preds
comps (cons comp rest))
@@ -739,8 +741,9 @@ See `icomplete-mode' and `minibuffer-setup-hook'."
(nconc before
(list
(setq icomplete--last-selected
- (propertize (car comps) 'face
- 'icomplete-selected-match)))
+ (cons (propertize (car comps) 'face
+ 'icomplete-selected-match)
+ (buffer-modified-tick)))))
after)
icomplete-separator)))))
- branch scratch/icomplete-vertical-mode-improvements created (now 0337e73), João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements d3b85d0 04/10: * lisp/icomplete.el (icomplete--render-vertical): Simplify slightly., João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements 136f71b 02/10: Distinguish fido-mode from icomplete-mode verticality, João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements 82f8a3d 03/10: Fix an edge case bug in icomplete.el where base-size wasn't restored, João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements 776633a 01/10: Improve icomplete-vertical-mode, João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements f751980 05/10: Don't break icomplete-vertical-mode scrolling when moving non-destructively,
João Távora <=
- scratch/icomplete-vertical-mode-improvements 24ddc91 07/10: Rename icomplete-rotate to icomplete-scroll, for clarity, João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements 94368e2 06/10: Adjust scrolling behaviour of icomplete-vertical-mode, João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements f7b22c0 08/10: Simplify icomplete-vertical-mode scrolling implementation, João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements 0337e73 10/10: Add annotation capability to icomplete-vertical-mode, João Távora, 2021/05/28
- scratch/icomplete-vertical-mode-improvements 37f0362 09/10: Update NEWS, João Távora, 2021/05/28