Skip to content

Commit 3b0938c

Browse files
committed
Render Ido suggestions using an overlay
* lisp/ido.el (ido--overlay): New variable. (ido-exhibit): Render with 'after-string' on an overlay (bug#38457).
1 parent d5d90dc commit 3b0938c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lisp/ido.el

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4492,6 +4492,8 @@ For details of keybindings, see `ido-find-file'."
44924492
(ido-tidy))
44934493
(throw 'ido contents))))
44944494

4495+
(defvar ido--overlay nil)
4496+
44954497
(defun ido-exhibit ()
44964498
"Post command hook for Ido."
44974499
;; Find matching files and display a list in the minibuffer.
@@ -4726,7 +4728,13 @@ For details of keybindings, see `ido-find-file'."
47264728
(let ((inf (ido-completions contents)))
47274729
(setq ido-show-confirm-message nil)
47284730
(ido-trace "inf" inf)
4729-
(insert inf))
4731+
(when ido--overlay
4732+
(delete-overlay ido--overlay))
4733+
(let ((o (make-overlay (point-max) (point-max) nil t t)))
4734+
(when (> (length inf) 0)
4735+
(put-text-property 0 1 'cursor t inf))
4736+
(overlay-put o 'after-string inf)
4737+
(setq ido--overlay o)))
47304738
))))
47314739

47324740
(defun ido-completions (name)

0 commit comments

Comments
 (0)