Skip to content

Commit

Permalink
Speed up annotations by only annotating visible candidates
Browse files Browse the repository at this point in the history
I was previously annotating all candidates, which is pointless. With
this change only the visible candidates will be annotated.

(I have to say, I'm a little surprised annotating all candidates was
so slow for some people (see #18): it seemed fast enough on my cheap 6
year-old chromebook, running Emacs in a Linux VM! I may need to get an
even slower computer...)
  • Loading branch information
oantolin committed Dec 13, 2020
1 parent 34e70ec commit a4c65f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions icomplete-vertical.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; Keywords: convenience, completion
;; Version: 0.3
;; Homepage: https://github.com/oantolin/icomplete-vertical
;; Package-Requires: ((emacs "24.4"))
;; Package-Requires: ((emacs "25.1"))

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -212,7 +212,7 @@ To be used as filter return advice for `icomplete--sorted-completions'."
'face 'completions-annotations
annotation))
(concat candidate annotation)))
completions)))
(seq-take completions icomplete-vertical-prospects-height))))
(setcdr last save) ; restore
(setcdr (last annotated) save) ; imitate
annotated)))))
Expand Down

0 comments on commit a4c65f2

Please sign in to comment.