[feature] New Preference setting : Use case-insensitive sorting in lists #1401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.