add action keyword when changing qury

This commit is contained in:
Jeremy Wu
2019-12-09 07:45:19 +11:00
parent 4d902c01a6
commit 6c4ab3b7f4

View File

@@ -58,7 +58,7 @@ namespace Wox.Plugin.Folder
return results; return results;
} }
private Result CreateFolderResult(string title, string path) private Result CreateFolderResult(string title, string path, string queryActionKeyword)
{ {
return new Result return new Result
{ {
@@ -82,7 +82,7 @@ namespace Wox.Plugin.Folder
} }
string changeTo = path.EndsWith("\\") ? path : path + "\\"; string changeTo = path.EndsWith("\\") ? path : path + "\\";
_context.API.ChangeQuery(changeTo); _context.API.ChangeQuery(queryActionKeyword + " " + changeTo);
return false; return false;
} }
}; };
@@ -93,7 +93,7 @@ namespace Wox.Plugin.Folder
string search = query.Search.ToLower(); string search = query.Search.ToLower();
var userFolderLinks = _settings.FolderLinks.Where( var userFolderLinks = _settings.FolderLinks.Where(
x => x.Nickname.StartsWith(search, StringComparison.OrdinalIgnoreCase)); x => x.Nickname.StartsWith(search, StringComparison.OrdinalIgnoreCase));
var results = userFolderLinks.Select(item => CreateFolderResult(item.Nickname, item.Path)) var results = userFolderLinks.Select(item => CreateFolderResult(item.Nickname, item.Path, query.ActionKeyword))
.ToList(); .ToList();
return results; return results;
} }
@@ -166,7 +166,7 @@ namespace Wox.Plugin.Folder
var result = var result =
fileSystemInfo is DirectoryInfo fileSystemInfo is DirectoryInfo
? CreateFolderResult(fileSystemInfo.Name, fileSystemInfo.FullName) ? CreateFolderResult(fileSystemInfo.Name, fileSystemInfo.FullName, query.ActionKeyword)
: CreateFileResult(fileSystemInfo.FullName); : CreateFileResult(fileSystemInfo.FullName);
results.Add(result); results.Add(result);
} }