From 6b791d8a89403b03f352839219f1ab95987c23e9 Mon Sep 17 00:00:00 2001 From: Johann Haarhoff Date: Tue, 9 Mar 2010 00:47:15 +0200 Subject: [PATCH] Add a trailing "/" to dirs in dialog autocomplete The autocomplete feature in the "Run" dialog now adds a trailing "/" when autocompleting directory names. This does three things: 1) shows you that you are completing a directory and not a filename, 2) saves one character of typing, and 3) makes it behave more consistent with shell (bash) autocompletion --- src/dialog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dialog.c b/src/dialog.c index 76c0c947..80aabadd 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -263,6 +263,8 @@ ScanFiles(const char *dir, const char *prefix, unsigned acceptmask, unsigned dec WMFindInArray(result, (WMMatchDataProc *) strmatch, de->d_name + prefixlen) == WANotFound) { suffix = wstrdup(de->d_name + prefixlen); + if (sb.st_mode & S_IFDIR) + wstrappend(suffix,"/"); WMAddToArray(result, suffix); } wfree(fullfilename);