-
Notifications
You must be signed in to change notification settings - Fork 290
[feature] New Preference setting : Use case-insensitive sorting in lists #1401
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
[feature] New Preference setting : Use case-insensitive sorting in lists #1401
Conversation
Commit 76a7a22 added "numeric sorting for all trees" (sourcegit-scm#597) but missed a case - for root items in RevisionFileTreeNode tree, which was still using ordinal string.Compare(). Fixed by refactoring the node sorting into a separate method, to make sure it's done the same way in both instances.
@love-linger would you consider merging this PR? It's a bit frustrating to switch between SourceGit and other tools (like Personally, I find it harder to locate names in case-sensitive lists. For example, in the list below,
(BTW, there's additionally a bug-fix for numerical sorting of root |
I've pushed a commit that use case-insensitive sorting in all filesystem related trees/lists by default. I do not want to add too many configurations. |
@love-linger Thanks! However, I just realized that |
Done |
Whether to sort lists using case-sensitive or case-insensitive ordering is a (usually strong) matter of taste and conventions.
To satisfy both camps, this option can now be toggled as a (global)
Preferences
checkbox (on theAppearance
tab). When toggling this option, aRefreshAll()
is performed to directly update visible lists.NOTE: This also affects the non-digit substrings in
NumericSort.Compare()
. Additionally, that method is now refactored to remove some redunant code.Fixed a missing case of numeric sorting, for root items in the
RevisionFileTreeNode
tree (which were still using ordinalstring.Compare()
instead of the intendedNumericSort.Compare()
). This is related to issue #597 and commit 76a7a22 which added "numeric sorting for all trees". The issue is corrected by refactoring the node sorting into a separate method, to make sure sorting is done the same way in both of the call-sites.To support sorting options in Local Changes (Unstaged / Staged) lists, the output list from
QueryLocalChanges()
is now sorted byPath
(instead of relying "blindly" on the sorting done by Git). Also,WorkingCopy.IsChanged()
is now simplified / optimized and will additionally react to changes in sorting order.