Skip to content

Commit 11d6623

Browse files
committed
#123 - sorting by file basename by default (instead of fullname with ext)
- new syntax `a-z.` and `true a-z.` introduced to allow explicitly sorting by filename with ext
1 parent 45e5f3c commit 11d6623

File tree

6 files changed

+198
-76
lines changed

6 files changed

+198
-76
lines changed

src/custom-sort/custom-sort-getComparator.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ const AB_EQUAL: number = 0
9797
const BaseItemForSorting1: FolderItemForSorting = {
9898
groupIdx: 1,
9999
isFolder: false,
100-
sortString: "References.md",
100+
sortString: "References",
101+
sortStringWithExt: "References.md",
101102
ctime: MOCK_TIMESTAMP + 222,
102103
mtime: MOCK_TIMESTAMP + 333,
103104
path: 'parent folder/References.md',

src/custom-sort/custom-sort-types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ export enum CustomSortGroupType {
1313

1414
export enum CustomSortOrder {
1515
alphabetical = 1, // = 1 to allow: if (customSortOrder) { ...
16+
alphabeticalWithFileExt,
1617
trueAlphabetical,
18+
trueAlphabeticalWithFileExt,
1719
alphabeticalReverse,
20+
alphabeticalReverseWithFileExt,
1821
trueAlphabeticalReverse,
22+
trueAlphabeticalReverseWithFileExt,
1923
byModifiedTime, // New to old
2024
byModifiedTimeAdvanced,
2125
byModifiedTimeReverse, // Old to new

0 commit comments

Comments
 (0)