Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ivy.el (ivy-completion-in-region): Allow sorting #1432

Merged
merged 1 commit into from
Feb 7, 2018

Conversation

basil-conto
Copy link
Collaborator

(ivy-sort-functions-alist): Default ivy-completion-in-region to no sorting.

(ivy-sort-functions-alist):
Default ivy-completion-in-region to no sorting.
@abo-abo
Copy link
Owner

abo-abo commented Feb 6, 2018

What's the reason for this change?

@basil-conto
Copy link
Collaborator Author

What's the reason for this change?

As with any addition of :sort t, it is to allow users to customise the sort function for those in-buffer completion functions which end up using ivy-completion-in-region, such as elisp-completion-at-point.

Before adding :sort t:

2018-02-06-185621_1600x900_scrot

After adding :sort t and (map-put ivy-sort-functions-alist #'ivy-completion-in-region #'string-lessp):

2018-02-06-185655_1600x900_scrot

Is there any reason why ivy-completing-read should have :sort t and not ivy-completion-in-region?

@basil-conto
Copy link
Collaborator Author

(Note that, in my example, adding an entry for elisp-completion-at-point in ivy-sort-functions-alist does not work because (ivy-state-caller ivy-last) is ivy-completion-in-region.)

@abo-abo abo-abo merged commit 6186c5a into abo-abo:master Feb 7, 2018
@abo-abo
Copy link
Owner

abo-abo commented Feb 7, 2018

Thanks.

@dieggsy
Copy link
Contributor

dieggsy commented Feb 7, 2018

Thanks for this @basil-conto

@basil-conto basil-conto deleted the blc/sort-in-region branch February 7, 2018 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants