From baad94b3127ed15227077cee8780442a153fdb93 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 17 May 2020 21:41:55 -0400 Subject: [PATCH] Add hacky fix for annoying extra history entries from ivy/swiper --- .emacs.d/init.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 93dad73..8f30d5d 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -390,6 +390,16 @@ (use-package ivy :ensure :delight :config + ;; hacky temp fix for issue where counsel-find-file drops the + ;; search string into history as well as the matched file + ;; reverts https://github.com/abo-abo/swiper/commit/334d08c + (defun ivy--update-history (hist) + (let ((item (ivy-state-current ivy-last))) + (cond ((equal item "")) + ((stringp item) + (set hist (cons (propertize item 'ivy-index ivy--index) + (delete item (symbol-value hist)))))))) + (ivy-mode 1)) (use-package ivy-hydra :ensure)