Skip to content

Commit

Permalink
"TAB" shouldn't delete input when no candidate
Browse files Browse the repository at this point in the history
ivy.el (ivy-partial-or-done): Update.

Fixes abo-abo#74
  • Loading branch information
abo-abo committed May 4, 2015
1 parent 41bc3e8 commit 2c39e10
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ When called twice in a row, exit the minibuffer with the current
candidate."
(interactive)
(if (eq this-command last-command)
(progn
(when (> (length ivy--current) 0)
(delete-minibuffer-contents)
(insert ivy--current)
(setq ivy-exit 'done)
Expand All @@ -290,10 +290,11 @@ candidate."
(new (try-completion postfix
(mapcar (lambda (str) (substring str (string-match postfix str)))
ivy--old-cands))))
(delete-region (minibuffer-prompt-end) (point-max))
(setcar (last parts) new)
(insert (mapconcat #'identity parts " ")
(if ivy-tab-space " " "")))))
(when new
(delete-region (minibuffer-prompt-end) (point-max))
(setcar (last parts) new)
(insert (mapconcat #'identity parts " ")
(if ivy-tab-space " " ""))))))

(defun ivy-immediate-done ()
"Exit the minibuffer with the current input."
Expand Down

0 comments on commit 2c39e10

Please sign in to comment.