branch: master commit fcb18e5484c32eea520a66a0c3c2d58de70bb9bd Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
ivy.el (ivy-read): Bring last history candidate to front --- ivy.el | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ivy.el b/ivy.el index 79d3bff..80a0e8d 100644 --- a/ivy.el +++ b/ivy.el @@ -145,8 +145,10 @@ If INDEX is non-nil select the corresponding candidate." ivy-minibuffer-map nil 'ivy-history)) - (pop ivy-history) - (add-to-list 'ivy-history ivy-text) + (when (eq ivy-exit 'done) + (pop ivy-history) + (setq ivy-history + (cons ivy-text (delete ivy-text ivy-history)))) (remove-hook 'post-command-hook #'ivy--exhibit))))) (defvar ivy-text ""