Skip to content

Commit

Permalink
Fix #14 again: just check (null comps) before padding
Browse files Browse the repository at this point in the history
  • Loading branch information
gempesaw committed Feb 14, 2015
1 parent 85587cd commit 612ba4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 2 additions & 9 deletions ido-vertical-mode.el
Expand Up @@ -88,14 +88,6 @@ so we can restore it when turning `ido-vertical-mode' off")
(const :tag "C-p/up, C-n/down are up/down in match. left or right cycle history or directory." C-n-C-p-up-down-left-right))
:group 'ido-vertical-mode)

(defun ido-vertical-comps-empty-p (comps)
(let ((comps-empty t))
(mapc (lambda (it)
(setq comps-empty
(and comps-empty (stringp it) (eq it ""))))
comps)
comps-empty))

;; borrowed from ido.el and modified to work better when vertical
(defun ido-vertical-completions (name)
;; Return the string that is displayed after the user's text.
Expand All @@ -106,6 +98,7 @@ so we can restore it when turning `ido-vertical-mode' off")
ido-merged-indicator))
(lencomps (length comps))
(additional-items-indicator (nth 3 ido-decorations))
(comps-empty (null comps))
first)

;; Keep the height of the suggestions list constant by padding
Expand Down Expand Up @@ -137,7 +130,7 @@ so we can restore it when turning `ido-vertical-mode' off")
;; empty. We pad the list with empty items to keep the list at a
;; constant height, so we have to check if the entire list is
;; empty, instead of (null comps)
(cond ((ido-vertical-comps-empty-p comps)
(cond (comps-empty
(cond
(ido-show-confirm-message
(or (nth 10 ido-decorations) " [Confirm]"))
Expand Down
2 changes: 0 additions & 2 deletions test/ido-vertical-mode-test.el
Expand Up @@ -48,7 +48,5 @@
(let ((comps '(""
(#(".ido.last" 1 4 (face flx-highlight-face)) "/Users/JS/")
(#("200-ido.el" 4 7 (face flx-highlight-face)) "/Users/JS/.emacs.d/configs/" "~/.emacs.d/configs/"))))
(should (not (ido-vertical-comps-empty-p comps)))
(should (ido-vertical-comps-empty-p '("" "" "")))
(setq ido-matches comps)
(should (ido-vertical-completions ""))))

0 comments on commit 612ba4e

Please sign in to comment.