diff options
| author | Dmitry Gutov | 2020-01-22 14:46:34 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2020-01-22 14:47:26 +0300 |
| commit | 3b0938c0420de2b845e7e8f8fbbb57ddc61718f2 (patch) | |
| tree | 8dac3e25a20118aad0101cbf53ebee417a9230b5 | |
| parent | d5d90dc4126e6878a89659ce88e71c193490c8d3 (diff) | |
| download | emacs-3b0938c0420de2b845e7e8f8fbbb57ddc61718f2.tar.gz emacs-3b0938c0420de2b845e7e8f8fbbb57ddc61718f2.zip | |
Render Ido suggestions using an overlay
* lisp/ido.el (ido--overlay): New variable.
(ido-exhibit): Render with 'after-string' on an overlay
(bug#38457).
| -rw-r--r-- | lisp/ido.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 83b88e4e81c..355be5eaa66 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -4492,6 +4492,8 @@ For details of keybindings, see `ido-find-file'." | |||
| 4492 | (ido-tidy)) | 4492 | (ido-tidy)) |
| 4493 | (throw 'ido contents)))) | 4493 | (throw 'ido contents)))) |
| 4494 | 4494 | ||
| 4495 | (defvar ido--overlay nil) | ||
| 4496 | |||
| 4495 | (defun ido-exhibit () | 4497 | (defun ido-exhibit () |
| 4496 | "Post command hook for Ido." | 4498 | "Post command hook for Ido." |
| 4497 | ;; Find matching files and display a list in the minibuffer. | 4499 | ;; Find matching files and display a list in the minibuffer. |
| @@ -4726,7 +4728,13 @@ For details of keybindings, see `ido-find-file'." | |||
| 4726 | (let ((inf (ido-completions contents))) | 4728 | (let ((inf (ido-completions contents))) |
| 4727 | (setq ido-show-confirm-message nil) | 4729 | (setq ido-show-confirm-message nil) |
| 4728 | (ido-trace "inf" inf) | 4730 | (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))) | ||
| 4730 | )))) | 4738 | )))) |
| 4731 | 4739 | ||
| 4732 | (defun ido-completions (name) | 4740 | (defun ido-completions (name) |