Skip to content

Commit ad25879

Browse files
Merge branch 'dev' into LocalizedLnkName
2 parents 1ae1752 + 43b8cc5 commit ad25879

File tree

16 files changed

+98
-65
lines changed

16 files changed

+98
-65
lines changed

.github/actions/spelling/expect.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,26 @@ mscorlib
3535
pythonw
3636
dotnet
3737
winget
38+
jjw24
39+
wolframalpha
40+
gmail
41+
duckduckgo
42+
facebook
43+
findicon
44+
baidu
45+
pls
46+
websearch
47+
qianlifeng
48+
userdata
49+
srchadmin
50+
EWX
51+
dlgtext
52+
CMD
53+
appref-ms
54+
appref
55+
TSource
56+
runas
57+
dpi
58+
popup
59+
ptr
60+
pluginindicator

.github/actions/spelling/patterns.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,9 @@
108108
# Localization keys
109109
#x:Key="[^"]+"
110110
#{DynamicResource [^"]+}
111+
112+
# html tag
113+
<\w+[^>]*>
114+
115+
#http/https
116+
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]

.github/workflows/spelling.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ jobs:
8282
post_comment: 0
8383
use_magic_file: 1
8484
experimental_apply_changes_via_bot: 1
85-
use_sarif: true # to show in pr page
85+
use_sarif: 0 # to show in pr page
8686
extra_dictionary_limit: 10
8787
check_commit_messages: commits title description
88-
only_check_changed_files: false
88+
only_check_changed_files: 1
8989
check_extra_dictionaries: ''
9090
quit_without_error: true
9191
extra_dictionaries:
@@ -96,6 +96,8 @@ jobs:
9696
cspell:csharp/csharp.txt
9797
cspell:dotnet/dotnet.txt
9898
cspell:python/src/python/python-lib.txt
99+
cspell:aws/aws.txt
100+
cspell:companies/src/companies.txt
99101
warnings:
100102
binary-file,deprecated-feature,large-file,limited-references,noisy-file,non-alpha-in-dictionary,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,unrecognized-spelling,no-newline-at-eof
101103

Plugins/Flow.Launcher.Plugin.PluginIndicator/Languages/en.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:system="clr-namespace:System;assembly=mscorlib">
44

5+
<system:String x:Key="flowlauncher_plugin_pluginindicator_result_subtitle">Activate {0} plugin action keyword</system:String>
6+
57
<system:String x:Key="flowlauncher_plugin_pluginindicator_plugin_name">Plugin Indicator</system:String>
68
<system:String x:Key="flowlauncher_plugin_pluginindicator_plugin_description">Provides plugins action words suggestions</system:String>
7-
8-
</ResourceDictionary>
9+
10+
</ResourceDictionary>

Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ public class Main : IPlugin, IPluginI18n
1010

1111
public List<Result> Query(Query query)
1212
{
13-
// if query contains more than one word, eg. github tips
14-
// user has decided to type something else rather than wanting to see the available action keywords
15-
if (query.SearchTerms.Length > 1)
16-
return new List<Result>();
17-
18-
var results = from keyword in PluginManager.NonGlobalPlugins.Keys
19-
where keyword.StartsWith(query.Search)
20-
let metadata = PluginManager.NonGlobalPlugins[keyword].Metadata
21-
where !metadata.Disabled
22-
select new Result
23-
{
24-
Title = keyword,
25-
SubTitle = $"Activate {metadata.Name} plugin",
26-
Score = 100,
27-
IcoPath = metadata.IcoPath,
28-
AutoCompleteText = $"{keyword}{Plugin.Query.TermSeparator}",
29-
Action = c =>
30-
{
31-
context.API.ChangeQuery($"{keyword}{Plugin.Query.TermSeparator}");
32-
return false;
33-
}
34-
};
13+
var results =
14+
from keyword in PluginManager.NonGlobalPlugins.Keys
15+
let plugin = PluginManager.NonGlobalPlugins[keyword].Metadata
16+
let keywordSearchResult = context.API.FuzzySearch(query.Search, keyword)
17+
let searchResult = keywordSearchResult.IsSearchPrecisionScoreMet() ? keywordSearchResult : context.API.FuzzySearch(query.Search, plugin.Name)
18+
let score = searchResult.Score
19+
where (searchResult.IsSearchPrecisionScoreMet()
20+
|| string.IsNullOrEmpty(query.Search)) // To list all available action keywords
21+
&& !plugin.Disabled
22+
select new Result
23+
{
24+
Title = keyword,
25+
SubTitle = string.Format(context.API.GetTranslation("flowlauncher_plugin_pluginindicator_result_subtitle"), plugin.Name),
26+
Score = score,
27+
IcoPath = plugin.IcoPath,
28+
AutoCompleteText = $"{keyword}{Plugin.Query.TermSeparator}",
29+
Action = c =>
30+
{
31+
context.API.ChangeQuery($"{keyword}{Plugin.Query.TermSeparator}");
32+
return false;
33+
}
34+
};
3535
return results.ToList();
3636
}
3737

Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"ID": "6A122269676E40EB86EB543B945932B9",
33
"ActionKeyword": "*",
44
"Name": "Plugin Indicator",
5-
"Description": "Provide plugin actionword suggestion",
5+
"Description": "Provides plugin action keyword suggestions",
66
"Author": "qianlifeng",
7-
"Version": "2.0.0",
7+
"Version": "2.0.1",
88
"Language": "csharp",
99
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1010
"ExecuteFileName": "Flow.Launcher.Plugin.PluginIndicator.dll",

Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<system:String x:Key="flowlauncher_plugin_program_suffixes_cannot_empty">File suffixes can't be empty</system:String>
5656
<system:String x:Key="flowlauncher_plugin_protocols_cannot_empty">Protocols can't be empty</system:String>
5757

58-
<system:String x:Key="flowlauncher_plugin_program_suffixes_excutable_types">File Suffixes</system:String>
58+
<system:String x:Key="flowlauncher_plugin_program_suffixes_executable_types">File Suffixes</system:String>
5959
<system:String x:Key="flowlauncher_plugin_program_suffixes_URL_types">URL Protocols</system:String>
6060
<system:String x:Key="flowlauncher_plugin_program_suffixes_URL_steam">Steam Games</system:String>
6161
<system:String x:Key="flowlauncher_plugin_program_suffixes_URL_epic">Epic Games</system:String>

Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
Margin="0,0,0,8"
163163
FontSize="16"
164164
FontWeight="SemiBold"
165-
Text="{DynamicResource flowlauncher_plugin_program_suffixes_excutable_types}" />
165+
Text="{DynamicResource flowlauncher_plugin_program_suffixes_executable_types}" />
166166
<CheckBox
167167
Name="apprefMS"
168168
Margin="10,0,0,0"

Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public UWP(Package package)
3838

3939
public void InitAppsInPackage(Package package)
4040
{
41-
var applist = new List<Application>();
41+
var apps = new List<Application>();
4242
// WinRT
4343
var appListEntries = package.GetAppListEntries();
4444
foreach (var app in appListEntries)
4545
{
4646
try
4747
{
4848
var tmp = new Application(app, this);
49-
applist.Add(tmp);
49+
apps.Add(tmp);
5050
}
5151
catch (Exception e)
5252
{
@@ -55,7 +55,7 @@ public void InitAppsInPackage(Package package)
5555
+ $"{FullName} from location {Location}", e);
5656
}
5757
}
58-
Apps = applist.ToArray();
58+
Apps = apps.ToArray();
5959

6060
try
6161
{
@@ -147,7 +147,7 @@ private PackageVersion GetPackageVersionFromManifest(XmlNode xmlRoot)
147147
}
148148

149149
ProgramLogger.LogException($"|UWP|GetPackageVersionFromManifest|{Location}" +
150-
"|Trying to get the package version of the UWP program, but an unknown UWP appmanifest version in package "
150+
"|Trying to get the package version of the UWP program, but an unknown UWP app-manifest version in package "
151151
+ $"{FullName} from location {Location}", new FormatException());
152152
return PackageVersion.Unknown;
153153
}
@@ -392,14 +392,14 @@ public Result Result(string query, IPublicAPI api)
392392
{
393393
title = $"{Name}: {Description}";
394394
var nameMatch = StringMatcher.FuzzySearch(query, Name);
395-
var desciptionMatch = StringMatcher.FuzzySearch(query, Description);
396-
if (desciptionMatch.Score > nameMatch.Score)
395+
var descriptionMatch = StringMatcher.FuzzySearch(query, Description);
396+
if (descriptionMatch.Score > nameMatch.Score)
397397
{
398-
for (int i = 0; i < desciptionMatch.MatchData.Count; i++)
398+
for (int i = 0; i < descriptionMatch.MatchData.Count; i++)
399399
{
400-
desciptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
400+
descriptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
401401
}
402-
matchResult = desciptionMatch;
402+
matchResult = descriptionMatch;
403403
}
404404
else matchResult = nameMatch;
405405
}
@@ -633,7 +633,7 @@ string TryToFindLogo(string uri, string path, int px)
633633
// }
634634
// else
635635
// {
636-
// ProgramLogger.LogException($"|UWP|ImageFromPath|{(string.IsNullOrEmpty(path) ? "Not Avaliable" : path)}" +
636+
// ProgramLogger.LogException($"|UWP|ImageFromPath|{(string.IsNullOrEmpty(path) ? "Not Available" : path)}" +
637637
// $"|Unable to get logo for {UserModelId} from {path} and" +
638638
// $" located in {Location}", new FileNotFoundException());
639639
// return new BitmapImage(new Uri(Constant.MissingImgIcon));
@@ -658,8 +658,8 @@ string TryToFindLogo(string uri, string path, int px)
658658
// var brush = new SolidColorBrush(color);
659659
// var pen = new Pen(brush, 1);
660660
// var backgroundArea = new Rect(0, 0, width, width);
661-
// var rectabgle = new RectangleGeometry(backgroundArea);
662-
// var rectDrawing = new GeometryDrawing(brush, pen, rectabgle);
661+
// var rectangle = new RectangleGeometry(backgroundArea);
662+
// var rectDrawing = new GeometryDrawing(brush, pen, rectangle);
663663
// group.Children.Add(rectDrawing);
664664

665665
// var imageArea = new Rect(x, y, image.Width, image.Height);

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,12 @@ private static IEnumerable<string> GetPathFromRegistry(RegistryKey root)
545545
.Distinct();
546546
}
547547

548-
private static string GetProgramPathFromRegistrySubKeys(RegistryKey root, string subkey)
548+
private static string GetProgramPathFromRegistrySubKeys(RegistryKey root, string subKey)
549549
{
550550
var path = string.Empty;
551551
try
552552
{
553-
using (var key = root.OpenSubKey(subkey))
553+
using (var key = root.OpenSubKey(subKey))
554554
{
555555
if (key == null)
556556
return string.Empty;

0 commit comments

Comments
 (0)