mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
Highlight how results matched
This commit is contained in:
@@ -5,6 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Storage;
|
||||
|
||||
namespace Wox.Plugin.Folder
|
||||
@@ -53,6 +54,7 @@ namespace Wox.Plugin.Folder
|
||||
Title = item.Nickname,
|
||||
IcoPath = item.Path,
|
||||
SubTitle = "Ctrl + Enter to open the directory",
|
||||
TitleHighlightData = StringMatcher.FuzzySearch(item.Nickname, search).MatchData,
|
||||
Action = c =>
|
||||
{
|
||||
if (c.SpecialKeyState.CtrlPressed)
|
||||
@@ -148,6 +150,8 @@ namespace Wox.Plugin.Folder
|
||||
}
|
||||
});
|
||||
|
||||
string searchNickname = new FolderLink { Path = query.Search }.Nickname;
|
||||
|
||||
//Add children directories
|
||||
DirectoryInfo[] dirs = new DirectoryInfo(search).GetDirectories();
|
||||
foreach (DirectoryInfo dir in dirs)
|
||||
@@ -162,6 +166,7 @@ namespace Wox.Plugin.Folder
|
||||
Title = dir.Name,
|
||||
IcoPath = dir.FullName,
|
||||
SubTitle = "Ctrl + Enter to open the directory",
|
||||
TitleHighlightData = StringMatcher.FuzzySearch(dir.Name, searchNickname).MatchData,
|
||||
Action = c =>
|
||||
{
|
||||
if (c.SpecialKeyState.CtrlPressed)
|
||||
@@ -197,6 +202,7 @@ namespace Wox.Plugin.Folder
|
||||
{
|
||||
Title = Path.GetFileName(filePath),
|
||||
IcoPath = filePath,
|
||||
TitleHighlightData = StringMatcher.FuzzySearch(file.Name, searchNickname).MatchData,
|
||||
Action = c =>
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user