Float unconflicted files in edit mode

This commit is contained in:
Caleb Owens 2024-10-09 11:21:51 +02:00
parent b3e3ebdb34
commit 39f9f50296

View File

@ -123,7 +123,16 @@
} }
const files = Array.from(outputMap.values()); const files = Array.from(outputMap.values());
files.sort((a, b) => a.path.localeCompare(b.path)); files.sort((a, b) => {
// Float conflicted files to the top
if (a.conflicted && !b.conflicted) {
return -1;
} else if (!a.conflicted && b.conflicted) {
return 1;
}
return a.path.localeCompare(b.path);
});
return files; return files;
}); });