small fix on the file dialog on linux to sort

This commit is contained in:
Adam D. Ruppe 2024-07-21 20:08:57 -04:00
parent 71a211bc5e
commit 1e1b096bc9
2 changed files with 5 additions and 3 deletions

View File

@ -15038,7 +15038,9 @@ class FilePicker : Dialog {
for(int i = 0; i < sa.length; i++) {
if(i == sb.length)
return 1;
return sa[i] - sb[i];
auto diff = sa[i] - sb[i];
if(diff)
return diff;
}
return 0;
@ -15144,7 +15146,7 @@ class FilePicker : Dialog {
if(current.length >= 2 && current[0 ..2] == "./")
current = current[2 .. $];
auto commonPrefix = loadFiles(".", current ~ "*");
auto commonPrefix = loadFiles(currentDirectory, current ~ "*");
if(commonPrefix.length)
lineEdit.content = commonPrefix;

View File

@ -509,7 +509,7 @@ public struct Selection {
keep_searching:
windowBuffer[0 .. endingSpot - currentSpot] = layouter.text[currentSpot .. endingSpot];
auto result = predicate(windowBuffer[0 .. endingSpot - currentSpot]);
auto result = predicate(windowBuffer[0 .. endingSpot - currentSpot]);
if(result !is null) {
// we're done, it was found
auto offsetStart = result is null ? currentSpot : cast(int) (result.ptr - windowBuffer.ptr);