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
Port ido-file-extension-order #453
Comments
Could be good enough. The sorting is performed only once per collection, i.e. just after you enter a directory.
I don't understand what you mean here. |
Oh, my bad, I forgot the end of the sentence. I meant the configuration interface for the variable:
|
Feel free to PR with a new sorting option. |
The question was rather "why isn't it a free-form field"? For example if a user wants to implement his own comparison function, he has to modify the variable in elisp, he can't use customize. As for the ido-sort thing, I'll try to submit a PR this week-end. |
Should have just said so:) |
Why exactly should this be inefficient? The sorting in |
Well, sorting requires at least as many comparisons as there are files, and
since the result of this test is the same for every comparison, I imagined
it would be nicer to factor it out of the comparison function. But for
reasonable number of files, the overhead should be neglectible.
The code appears to be working as-is, I'll make the PR now (sorry, I had
less time than I thought in the previous weeks). Is it ok that the code
depends on ido?
|
This is just the sorting function, as suggested in issue abo-abo#453. I'm not sure of how this option is best presented to the user. Also, in the long term, it would probably be a good idea to create a "purely ivy" variable replacing `ido-file-extensions-order`, in which case the new function could completely replace the default function.
It would be nice to have a feature similar to
ido-file-extension-order
: it allows to specify a set of extensions which should be shown first in the file list. It is the same idea as "boring files", except that the unwanted extensions are still shown if needed, just further down the list.The following seems to do the job on a system where
ido
is available:It is quite unefficient because it will test for
ido-file-extensions-order
at each comparison... so merely a proof of concept.By the way, is there a good reason for functions in
ivy-sort-functions-alist
to be restricted to 3 values?The text was updated successfully, but these errors were encountered: