Remove extra information in subtitle (discussion #706)

Fix index search keyword not working
This commit is contained in:
Hongtao Zhang 2022-09-24 14:31:32 -05:00
parent 2c3df3f4db
commit d973826333
No known key found for this signature in database
GPG key ID: 75F655B91C7AC9BB
2 changed files with 10 additions and 7 deletions

View file

@ -54,7 +54,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{
Title = title,
IcoPath = path,
SubTitle = subtitle,
SubTitle = Path.GetDirectoryName(path),
AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder),
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
Action = c =>
@ -218,7 +218,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
var result = new Result
{
Title = Path.GetFileName(filePath),
SubTitle = filePath,
SubTitle = Path.GetDirectoryName(filePath),
IcoPath = filePath,
AutoCompleteText = GetPathWithActionKeyword(filePath, ResultType.File),
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, Path.GetFileName(filePath)).MatchData,
@ -229,7 +229,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{
if (File.Exists(filePath) && c.SpecialKeyState.CtrlPressed && c.SpecialKeyState.ShiftPressed)
{
Task.Run(() =>
_ = Task.Run(() =>
{
try
{

View file

@ -47,7 +47,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search
// This allows the user to type the below action keywords and see/search the list of quick folder links
if (ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword)
|| ActionKeywordMatch(query, Settings.ActionKeyword.QuickAccessActionKeyword)
|| ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword))
|| ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword)
|| ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword))
{
if (string.IsNullOrEmpty(query.Search))
return QuickAccess.AccessLinkListAll(query, Settings.QuickAccessLinks);
@ -166,14 +167,16 @@ namespace Flow.Launcher.Plugin.Explorer.Search
var useIndexSearch = Settings.IndexSearchEngine is Settings.IndexSearchEngineOption.WindowsIndex
&& UseWindowsIndexForDirectorySearch(locationPath);
var retrievedDirectoryPath = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath);
if (locationPath.EndsWith(":\\"))
if (retrievedDirectoryPath.EndsWith(":\\"))
{
results.Add(ResultManager.CreateDriveSpaceDisplayResult(locationPath, useIndexSearch));
results.Add(ResultManager.CreateDriveSpaceDisplayResult(retrievedDirectoryPath, useIndexSearch));
}
else
{
results.Add(ResultManager.CreateOpenCurrentFolderResult(locationPath, useIndexSearch));
results.Add(ResultManager.CreateOpenCurrentFolderResult(retrievedDirectoryPath, useIndexSearch));
}
if (token.IsCancellationRequested)