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

commented Feb 6, 2018

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

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

This comment has been minimized.

Copy link
Owner

commented Feb 6, 2018

What's the reason for this change?

@basil-conto

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 6, 2018

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

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 6, 2018

(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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@abo-abo

This comment has been minimized.

Copy link
Owner

commented Feb 7, 2018

Thanks.

@dieggsy

This comment has been minimized.

Copy link
Contributor

commented Feb 7, 2018

Thanks for this @basil-conto

@basil-conto basil-conto deleted the basil-conto:blc/sort-in-region branch Feb 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.