@@ -17,6 +17,8 @@ public class Main : IPlugin, ISettingProvider, IPluginI18n, ISavable, IContextMe
17
17
public const string DeleteFileFolderImagePath = "Images\\ deletefilefolder.png" ;
18
18
public const string CopyImagePath = "Images\\ copy.png" ;
19
19
20
+ private string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory" ;
21
+
20
22
private static List < string > _driverNames ;
21
23
private PluginInitContext _context ;
22
24
@@ -86,13 +88,13 @@ private static bool IsDriveOrSharedFolder(string search)
86
88
return false ;
87
89
}
88
90
89
- private Result CreateFolderResult ( string title , string path , Query query )
91
+ private Result CreateFolderResult ( string title , string subtitle , string path , Query query )
90
92
{
91
93
return new Result
92
94
{
93
95
Title = title ,
94
96
IcoPath = path ,
95
- SubTitle = "Ctrl + Enter to open the directory" ,
97
+ SubTitle = subtitle ,
96
98
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , title ) . MatchData ,
97
99
Action = c =>
98
100
{
@@ -126,7 +128,7 @@ private List<Result> GetUserFolderResults(Query query)
126
128
var userFolderLinks = _settings . FolderLinks . Where (
127
129
x => x . Nickname . StartsWith ( search , StringComparison . OrdinalIgnoreCase ) ) ;
128
130
var results = userFolderLinks . Select ( item =>
129
- CreateFolderResult ( item . Nickname , item . Path , query ) ) . ToList ( ) ;
131
+ CreateFolderResult ( item . Nickname , DefaultFolderSubtitleString , item . Path , query ) ) . ToList ( ) ;
130
132
return results ;
131
133
}
132
134
@@ -199,6 +201,8 @@ private List<Result> QueryInternal_Directory_Exists(Query query)
199
201
var folderList = new List < Result > ( ) ;
200
202
var fileList = new List < Result > ( ) ;
201
203
204
+ var folderSubtitleString = DefaultFolderSubtitleString ;
205
+
202
206
try
203
207
{
204
208
// search folder and add results
@@ -211,7 +215,10 @@ private List<Result> QueryInternal_Directory_Exists(Query query)
211
215
212
216
if ( fileSystemInfo is DirectoryInfo )
213
217
{
214
- folderList . Add ( CreateFolderResult ( fileSystemInfo . Name , fileSystemInfo . FullName , query ) ) ;
218
+ if ( searchOption == SearchOption . AllDirectories )
219
+ folderSubtitleString = fileSystemInfo . FullName ;
220
+
221
+ folderList . Add ( CreateFolderResult ( fileSystemInfo . Name , folderSubtitleString , fileSystemInfo . FullName , query ) ) ;
215
222
}
216
223
else
217
224
{
@@ -240,6 +247,7 @@ private static Result CreateFileResult(string filePath, Query query)
240
247
var result = new Result
241
248
{
242
249
Title = Path . GetFileName ( filePath ) ,
250
+ SubTitle = filePath ,
243
251
IcoPath = filePath ,
244
252
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , Path . GetFileName ( filePath ) ) . MatchData ,
245
253
Action = c =>
0 commit comments