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);