From 1e1b096bc989984f1112df53e1def6b97238aaba Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sun, 21 Jul 2024 20:08:57 -0400 Subject: [PATCH] small fix on the file dialog on linux to sort --- minigui.d | 6 ++++-- textlayouter.d | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/minigui.d b/minigui.d index eae2eba..a3c4a15 100644 --- a/minigui.d +++ b/minigui.d @@ -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; diff --git a/textlayouter.d b/textlayouter.d index 5c08995..d85bb51 100644 --- a/textlayouter.d +++ b/textlayouter.d @@ -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);