Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

[HOLD] Sort project list alphabetically #8977

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

[HOLD] Sort project list alphabetically #8977

wants to merge 7 commits into from

Conversation

brunnopleffken
Copy link
Contributor

Really useful and missing feature if you are used to switch between multiple projects in a matter of minutes (like me) and have a lot of them. It sounds silly, but may save you some precious time and patience.

@larz0
Copy link
Member

larz0 commented Sep 5, 2014

Nice. I have this problem too.

@marcelgerber
Copy link
Contributor

Well, I like the current order better. Maybe this should be a pref.

// Changing the case (upper or lower) ensures a case insensitive sort
var aFolder = a.folder.toLowerCase();
var bFolder = b.folder.toLowerCase();
return (aFolder < bFolder) ? -1 : (aFolder > bFolder) ? 1 : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use .localeCompare().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and .toLocaleLowerCase()

@brunnopleffken
Copy link
Contributor Author

Oops, my bad! Now, using .localeCompare()and .toLocaleLowerCase(). It is working correctly with accented letters like À, Á, Ü, etc.

Ignore the "merge branch" stuff, I was working on my other outdated machine and I messed up everything there...

brackets.getLocale()
// Changing the case (upper or lower) ensures a case insensitive sort
var aFolder = a.folder.toLocaleLowerCase();
var bFolder = b.folder.toLocaleLowerCase();
return aFolder.localeCompare(bFolder, brackets.getLocale());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually use the options (3rd param) {numeric: true}

Added param for numeric sorting
@le717
Copy link
Contributor

le717 commented Sep 8, 2014

This sounds good, but I'm with @marcelgerber and would rather this be a preference. :)

@ingorichter
Copy link
Contributor

Please add a preference for this setting, since this is and always will be a matter of taste.

One other option to sort the list is by last time opened. Just a suggestion for future improvement.

@marcelgerber
Copy link
Contributor

@ingorichter The list is already sorted by last time opened (by default).

@ingorichter
Copy link
Contributor

@marcelgerber good point, bad example. I wanted to make the point that there might be more options that would justify a preference.

@peterflynn
Copy link
Member

Adding "HOLD" indicator to title so we hold off on merging until a pref is added. The default should still be to sort by most-recently opened, as in current releases.

@peterflynn peterflynn changed the title Sort project list alphabetically [HOLD] Sort project list alphabetically Sep 29, 2014
@ingorichter
Copy link
Contributor

@brunnopleffken Would you mind adding the preference for the sort option? It would be great to move forward with this PR. Thanks.

@brunnopleffken
Copy link
Contributor Author

@ingorichter Nice, I'll work on it... ;)

@le717
Copy link
Contributor

le717 commented Jan 12, 2015

@brunnopleffken I would like to see this in core, but the remaining issue (needs to be a pref) still needs to be addressed. Can you make that change soon?

@prafulVaishnav
Copy link
Contributor

@brunnopleffken Hii.. Just wanted to know if you got the time to add the preference for it, so that it can be merged..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet