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.
This commit is contained in:
parent
a95ef966ae
commit
8f85a392d8
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
:keymap counsel-projectile-switch-to-buffer-map
|
||||||
:caller 'counsel-projectile-switch-to-buffer))
|
:caller 'counsel-projectile-switch-to-buffer))
|
||||||
|
|
||||||
(unless (assq #'counsel-projectile-switch-to-buffer ivy-sort-functions-alist)
|
(unless (assq #'counsel-projectile--project-buffers ivy-sort-functions-alist)
|
||||||
(push (list #'counsel-projectile-switch-to-buffer) ivy-sort-functions-alist))
|
(push (list #'counsel-projectile--project-buffers) ivy-sort-functions-alist))
|
||||||
|
|
||||||
(ivy-set-display-transformer
|
(ivy-set-display-transformer
|
||||||
'counsel-projectile-switch-to-buffer
|
'counsel-projectile-switch-to-buffer
|
||||||
|
|
@ -1242,8 +1242,8 @@ If not inside a project, call `counsel-projectile-switch-project'."
|
||||||
:keymap counsel-projectile-map
|
:keymap counsel-projectile-map
|
||||||
:caller 'counsel-projectile)))
|
:caller 'counsel-projectile)))
|
||||||
|
|
||||||
(unless (assq #'counsel-projectile ivy-sort-functions-alist)
|
(unless (assq #'counsel-projectile--project-buffers-and-files ivy-sort-functions-alist)
|
||||||
(push (list #'counsel-projectile) ivy-sort-functions-alist))
|
(push (list #'counsel-projectile--project-buffers-and-files) ivy-sort-functions-alist))
|
||||||
|
|
||||||
(ivy-set-display-transformer
|
(ivy-set-display-transformer
|
||||||
'counsel-projectile
|
'counsel-projectile
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue