Skip to content

Commit

Permalink
fix: sort modes map incorrecly to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
antoKeinanen committed Oct 4, 2023
1 parent 5a6a367 commit 48419af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,18 +361,18 @@ export default class AdvancedMerge extends Plugin {
private sortNotes(files: Array<TFile>): Array<TFile> {
switch (this.settings.sortMode) {
case "alphabetical":
return files.sort((a, b) => a.name.localeCompare(b.name));
case "creationDate":
return files.sort((a, b) => a.stat.ctime - b.stat.ctime);
case "logical":
default:
return files.sort((a, b) =>
a.path.localeCompare(b.path, undefined, {
numeric: true,
sensitivity: "base",
usage: "sort",
}),
);
case "creationDate":
return files.sort((a, b) => a.stat.ctime - b.stat.ctime);
case "logical":
default:
return files.reverse();
}
}

Expand Down

0 comments on commit 48419af

Please sign in to comment.