From 8f85a392d860007b799d53175781aa7810174709 Mon Sep 17 00:00:00 2001 From: Eric Danan Date: Sun, 27 May 2018 22:28:12 +0200 Subject: [PATCH] counsel-projectile, cp-switch-to-buffer: fix default sorting When the collection is a function, it is this function that must be added to `ivy-sort-functions-alist`. Adding the caller instead has no effect. Note that at the moment, sorting may not work correctly if the default is changed, due to an issue in ivy with sorting with collection functions. See abo-abo/swiper/pull/1592. --- counsel-projectile.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/counsel-projectile.el b/counsel-projectile.el index 00bf8ea..b47d304 100644 --- a/counsel-projectile.el +++ b/counsel-projectile.el @@ -511,8 +511,8 @@ This simply applies the same transformer as in `ivy-switch-buffer', which is `iv :keymap counsel-projectile-switch-to-buffer-map :caller 'counsel-projectile-switch-to-buffer)) -(unless (assq #'counsel-projectile-switch-to-buffer ivy-sort-functions-alist) - (push (list #'counsel-projectile-switch-to-buffer) ivy-sort-functions-alist)) +(unless (assq #'counsel-projectile--project-buffers ivy-sort-functions-alist) + (push (list #'counsel-projectile--project-buffers) ivy-sort-functions-alist)) (ivy-set-display-transformer 'counsel-projectile-switch-to-buffer @@ -1242,8 +1242,8 @@ If not inside a project, call `counsel-projectile-switch-project'." :keymap counsel-projectile-map :caller 'counsel-projectile))) -(unless (assq #'counsel-projectile ivy-sort-functions-alist) - (push (list #'counsel-projectile) ivy-sort-functions-alist)) +(unless (assq #'counsel-projectile--project-buffers-and-files ivy-sort-functions-alist) + (push (list #'counsel-projectile--project-buffers-and-files) ivy-sort-functions-alist)) (ivy-set-display-transformer 'counsel-projectile