From 113baac567f91b30a7fb8164fa72eafb7cfb68e0 Mon Sep 17 00:00:00 2001 From: dcog989 Date: Tue, 22 Jul 2025 23:48:11 +0100 Subject: [PATCH 01/15] Smart thousands and decimals ## Core Logic * **Advanced Number Parsing:** We now process numbers with various decimal and thousand-separator formats (e.g., `1,234.56` and `1.234,56`). We distinguish between separator types based on their position and surrounding digits. * **Context-Aware Output Formatting:** We now mirror the output format based on the user's input. If a query includes thousand separators, the result will also have them. The decimal separator in the result will match the one used in the query. ## Code Cleanup * **Deleted Unused File:** `NumberTranslator.cs` was unused and therefore removed. * **Removed Redundant UI Code:** The `CalculatorSettings_Loaded` event handler in `CalculatorSettings.xaml.cs` (and its XAML registration) was removed. The functionality was already handled automatically by data binding. ## Maintainability * **Added Code Documentation:** An XML summary comment was added to the new `NormalizeNumber` method in `Main.cs` to clarify its purpose. So, the plugin is now much more flexible, and will accept whatever format the user gives it regardless of Windows region settings. --- .../Flow.Launcher.Plugin.Calculator/Main.cs | 157 ++++++++++++++---- .../NumberTranslator.cs | 91 ---------- .../Views/CalculatorSettings.xaml | 1 - .../Views/CalculatorSettings.xaml.cs | 8 - .../plugin.json | 6 +- 5 files changed, 129 insertions(+), 134 deletions(-) delete mode 100644 Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 3d06c4ce0..2787adbbc 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Windows.Controls; @@ -23,6 +24,7 @@ namespace Flow.Launcher.Plugin.Calculator @"[ei]|[0-9]|0x[\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" + @")+$", RegexOptions.Compiled); private static readonly Regex RegBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled); + private static readonly Regex ThousandGroupRegex = new Regex(@"\B(?=(\d{3})+(?!\d))"); private static Engine MagesEngine; private const string comma = ","; private const string dot = "."; @@ -32,6 +34,9 @@ namespace Flow.Launcher.Plugin.Calculator private static Settings _settings; private static SettingsViewModel _viewModel; + private string _inputDecimalSeparator; + private bool _inputUsesGroupSeparators; + public void Init(PluginInitContext context) { Context = context; @@ -54,20 +59,13 @@ namespace Flow.Launcher.Plugin.Calculator return new List(); } + _inputDecimalSeparator = null; + _inputUsesGroupSeparators = false; + try { - string expression; - - switch (_settings.DecimalSeparator) - { - case DecimalSeparator.Comma: - case DecimalSeparator.UseSystemLocale when CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == ",": - expression = query.Search.Replace(",", "."); - break; - default: - expression = query.Search; - break; - } + var numberRegex = new Regex(@"[\d\.,]+"); + var expression = numberRegex.Replace(query.Search, m => NormalizeNumber(m.Value)); var result = MagesEngine.Interpret(expression); @@ -80,7 +78,7 @@ namespace Flow.Launcher.Plugin.Calculator if (!string.IsNullOrEmpty(result?.ToString())) { decimal roundedResult = Math.Round(Convert.ToDecimal(result), _settings.MaxDecimalPlaces, MidpointRounding.AwayFromZero); - string newResult = ChangeDecimalSeparator(roundedResult, GetDecimalSeparator()); + string newResult = FormatResult(roundedResult); return new List { @@ -115,6 +113,121 @@ namespace Flow.Launcher.Plugin.Calculator return new List(); } + + /// + /// Parses a string representation of a number, detecting its format. It uses structural analysis + /// (checking for 3-digit groups) and falls back to system culture for ambiguous cases (e.g., "1,234"). + /// It sets instance fields to remember the user's format for later output formatting. + /// + /// A normalized number string with '.' as the decimal separator for the Mages engine. + private string NormalizeNumber(string numberStr) + { + var systemFormat = CultureInfo.CurrentCulture.NumberFormat; + string systemDecimalSeparator = systemFormat.NumberDecimalSeparator; + + bool hasDot = numberStr.Contains(dot); + bool hasComma = numberStr.Contains(comma); + + // Unambiguous case: both separators are present. The last one wins as decimal separator. + if (hasDot && hasComma) + { + _inputUsesGroupSeparators = true; + int lastDotPos = numberStr.LastIndexOf(dot); + int lastCommaPos = numberStr.LastIndexOf(comma); + + if (lastDotPos > lastCommaPos) // e.g. 1,234.56 + { + _inputDecimalSeparator = dot; + return numberStr.Replace(comma, string.Empty); + } + else // e.g. 1.234,56 + { + _inputDecimalSeparator = comma; + return numberStr.Replace(dot, string.Empty).Replace(comma, dot); + } + } + + if (hasComma) + { + string[] parts = numberStr.Split(','); + // If all parts after the first are 3 digits, it's a potential group separator. + bool isGroupCandidate = parts.Length > 1 && parts.Skip(1).All(p => p.Length == 3); + + if (isGroupCandidate) + { + // Ambiguous case: "1,234". Resolve using culture. + if (systemDecimalSeparator == comma) + { + _inputDecimalSeparator = comma; + return numberStr.Replace(comma, dot); + } + else + { + _inputUsesGroupSeparators = true; + return numberStr.Replace(comma, string.Empty); + } + } + else + { + // Unambiguous decimal: "123,45" or "1,2,345" + _inputDecimalSeparator = comma; + return numberStr.Replace(comma, dot); + } + } + + if (hasDot) + { + string[] parts = numberStr.Split('.'); + bool isGroupCandidate = parts.Length > 1 && parts.Skip(1).All(p => p.Length == 3); + + if (isGroupCandidate) + { + if (systemDecimalSeparator == dot) + { + _inputDecimalSeparator = dot; + return numberStr; + } + else + { + _inputUsesGroupSeparators = true; + return numberStr.Replace(dot, string.Empty); + } + } + else + { + _inputDecimalSeparator = dot; + return numberStr; // Already in Mages-compatible format + } + } + + // No separators. + return numberStr; + } + + private string FormatResult(decimal roundedResult) + { + // Use the detected decimal separator from the input; otherwise, fall back to settings. + string decimalSeparator = _inputDecimalSeparator ?? GetDecimalSeparator(); + string groupSeparator = decimalSeparator == dot ? comma : dot; + + string resultStr = roundedResult.ToString(CultureInfo.InvariantCulture); + + string[] parts = resultStr.Split('.'); + string integerPart = parts[0]; + string fractionalPart = parts.Length > 1 ? parts[1] : string.Empty; + + if (_inputUsesGroupSeparators) + { + integerPart = ThousandGroupRegex.Replace(integerPart, groupSeparator); + } + + if (!string.IsNullOrEmpty(fractionalPart)) + { + return integerPart + decimalSeparator + fractionalPart; + } + + return integerPart; + } private bool CanCalculate(Query query) { @@ -134,27 +247,9 @@ namespace Flow.Launcher.Plugin.Calculator return false; } - if ((query.Search.Contains(dot) && GetDecimalSeparator() != dot) || - (query.Search.Contains(comma) && GetDecimalSeparator() != comma)) - return false; - return true; } - private string ChangeDecimalSeparator(decimal value, string newDecimalSeparator) - { - if (String.IsNullOrEmpty(newDecimalSeparator)) - { - return value.ToString(); - } - - var numberFormatInfo = new NumberFormatInfo - { - NumberDecimalSeparator = newDecimalSeparator - }; - return value.ToString(numberFormatInfo); - } - private static string GetDecimalSeparator() { string systemDecimalSeparator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator; diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs b/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs deleted file mode 100644 index 4eacb9d34..000000000 --- a/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System.Globalization; -using System.Text; -using System.Text.RegularExpressions; - -namespace Flow.Launcher.Plugin.Calculator -{ - /// - /// Tries to convert all numbers in a text from one culture format to another. - /// - public class NumberTranslator - { - private readonly CultureInfo sourceCulture; - private readonly CultureInfo targetCulture; - private readonly Regex splitRegexForSource; - private readonly Regex splitRegexForTarget; - - private NumberTranslator(CultureInfo sourceCulture, CultureInfo targetCulture) - { - this.sourceCulture = sourceCulture; - this.targetCulture = targetCulture; - - this.splitRegexForSource = GetSplitRegex(this.sourceCulture); - this.splitRegexForTarget = GetSplitRegex(this.targetCulture); - } - - /// - /// Create a new - returns null if no number conversion - /// is required between the cultures. - /// - /// source culture - /// target culture - /// - public static NumberTranslator Create(CultureInfo sourceCulture, CultureInfo targetCulture) - { - bool conversionRequired = sourceCulture.NumberFormat.NumberDecimalSeparator != targetCulture.NumberFormat.NumberDecimalSeparator - || sourceCulture.NumberFormat.PercentGroupSeparator != targetCulture.NumberFormat.PercentGroupSeparator - || sourceCulture.NumberFormat.NumberGroupSizes != targetCulture.NumberFormat.NumberGroupSizes; - return conversionRequired - ? new NumberTranslator(sourceCulture, targetCulture) - : null; - } - - /// - /// Translate from source to target culture. - /// - /// - /// - public string Translate(string input) - { - return this.Translate(input, this.sourceCulture, this.targetCulture, this.splitRegexForSource); - } - - /// - /// Translate from target to source culture. - /// - /// - /// - public string TranslateBack(string input) - { - return this.Translate(input, this.targetCulture, this.sourceCulture, this.splitRegexForTarget); - } - - private string Translate(string input, CultureInfo cultureFrom, CultureInfo cultureTo, Regex splitRegex) - { - var outputBuilder = new StringBuilder(); - - string[] tokens = splitRegex.Split(input); - foreach (string token in tokens) - { - decimal number; - outputBuilder.Append( - decimal.TryParse(token, NumberStyles.Number, cultureFrom, out number) - ? number.ToString(cultureTo) - : token); - } - - return outputBuilder.ToString(); - } - - private Regex GetSplitRegex(CultureInfo culture) - { - var splitPattern = $"((?:\\d|{Regex.Escape(culture.NumberFormat.NumberDecimalSeparator)}"; - if (!string.IsNullOrEmpty(culture.NumberFormat.NumberGroupSeparator)) - { - splitPattern += $"|{Regex.Escape(culture.NumberFormat.NumberGroupSeparator)}"; - } - splitPattern += ")+)"; - return new Regex(splitPattern); - } - } -} diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml index ceee3897c..36beebc33 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml @@ -10,7 +10,6 @@ xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Calculator.ViewModels" d:DesignHeight="450" d:DesignWidth="800" - Loaded="CalculatorSettings_Loaded" mc:Ignorable="d"> diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs index edb73470c..117a19b25 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs @@ -1,4 +1,3 @@ -using System.Windows; using System.Windows.Controls; using Flow.Launcher.Plugin.Calculator.ViewModels; @@ -19,13 +18,6 @@ namespace Flow.Launcher.Plugin.Calculator.Views DataContext = viewModel; InitializeComponent(); } - - private void CalculatorSettings_Loaded(object sender, RoutedEventArgs e) - { - DecimalSeparatorComboBox.SelectedItem = _settings.DecimalSeparator; - MaxDecimalPlaces.SelectedItem = _settings.MaxDecimalPlaces; - } } - } diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index 3168edfcc..739572930 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -2,9 +2,9 @@ "ID": "CEA0FDFC6D3B4085823D60DC76F28855", "ActionKeyword": "*", "Name": "Calculator", - "Description": "Perform mathematical calculations (including hexadecimal values)", - "Author": "cxfksword", - "Version": "1.0.0", + "Description": "Perform mathematical calculations (including hexadecimal values). Use ',' or '.' as thousand separator or decimal place.", + "Author": "cxfksword, dcog989", + "Version": "1.1.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Calculator.dll", From c83a29fb1824e0f4d11a662bdee62c3b057ab1c1 Mon Sep 17 00:00:00 2001 From: dcog989 Date: Wed, 23 Jul 2025 01:18:26 +0100 Subject: [PATCH 02/15] PR review changes --- .../Flow.Launcher.Plugin.Calculator/Main.cs | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 2787adbbc..2894c2159 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -25,6 +25,8 @@ namespace Flow.Launcher.Plugin.Calculator @")+$", RegexOptions.Compiled); private static readonly Regex RegBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled); private static readonly Regex ThousandGroupRegex = new Regex(@"\B(?=(\d{3})+(?!\d))"); + private static readonly Regex NumberRegex = new Regex(@"[\d\.,]+", RegexOptions.Compiled); + private static Engine MagesEngine; private const string comma = ","; private const string dot = "."; @@ -34,8 +36,15 @@ namespace Flow.Launcher.Plugin.Calculator private static Settings _settings; private static SettingsViewModel _viewModel; - private string _inputDecimalSeparator; - private bool _inputUsesGroupSeparators; + /// + /// Holds the formatting information for a single query. + /// This is used to ensure thread safety by keeping query state local. + /// + private class ParsingContext + { + public string InputDecimalSeparator { get; set; } + public bool InputUsesGroupSeparators { get; set; } + } public void Init(PluginInitContext context) { @@ -59,13 +68,11 @@ namespace Flow.Launcher.Plugin.Calculator return new List(); } - _inputDecimalSeparator = null; - _inputUsesGroupSeparators = false; + var context = new ParsingContext(); try { - var numberRegex = new Regex(@"[\d\.,]+"); - var expression = numberRegex.Replace(query.Search, m => NormalizeNumber(m.Value)); + var expression = NumberRegex.Replace(query.Search, m => NormalizeNumber(m.Value, context)); var result = MagesEngine.Interpret(expression); @@ -78,7 +85,7 @@ namespace Flow.Launcher.Plugin.Calculator if (!string.IsNullOrEmpty(result?.ToString())) { decimal roundedResult = Math.Round(Convert.ToDecimal(result), _settings.MaxDecimalPlaces, MidpointRounding.AwayFromZero); - string newResult = FormatResult(roundedResult); + string newResult = FormatResult(roundedResult, context); return new List { @@ -117,10 +124,10 @@ namespace Flow.Launcher.Plugin.Calculator /// /// Parses a string representation of a number, detecting its format. It uses structural analysis /// (checking for 3-digit groups) and falls back to system culture for ambiguous cases (e.g., "1,234"). - /// It sets instance fields to remember the user's format for later output formatting. + /// It populates the provided ParsingContext with the detected format for later use. /// /// A normalized number string with '.' as the decimal separator for the Mages engine. - private string NormalizeNumber(string numberStr) + private string NormalizeNumber(string numberStr, ParsingContext context) { var systemFormat = CultureInfo.CurrentCulture.NumberFormat; string systemDecimalSeparator = systemFormat.NumberDecimalSeparator; @@ -131,18 +138,18 @@ namespace Flow.Launcher.Plugin.Calculator // Unambiguous case: both separators are present. The last one wins as decimal separator. if (hasDot && hasComma) { - _inputUsesGroupSeparators = true; + context.InputUsesGroupSeparators = true; int lastDotPos = numberStr.LastIndexOf(dot); int lastCommaPos = numberStr.LastIndexOf(comma); if (lastDotPos > lastCommaPos) // e.g. 1,234.56 { - _inputDecimalSeparator = dot; + context.InputDecimalSeparator = dot; return numberStr.Replace(comma, string.Empty); } else // e.g. 1.234,56 { - _inputDecimalSeparator = comma; + context.InputDecimalSeparator = comma; return numberStr.Replace(dot, string.Empty).Replace(comma, dot); } } @@ -158,19 +165,19 @@ namespace Flow.Launcher.Plugin.Calculator // Ambiguous case: "1,234". Resolve using culture. if (systemDecimalSeparator == comma) { - _inputDecimalSeparator = comma; + context.InputDecimalSeparator = comma; return numberStr.Replace(comma, dot); } else { - _inputUsesGroupSeparators = true; + context.InputUsesGroupSeparators = true; return numberStr.Replace(comma, string.Empty); } } else { // Unambiguous decimal: "123,45" or "1,2,345" - _inputDecimalSeparator = comma; + context.InputDecimalSeparator = comma; return numberStr.Replace(comma, dot); } } @@ -184,18 +191,18 @@ namespace Flow.Launcher.Plugin.Calculator { if (systemDecimalSeparator == dot) { - _inputDecimalSeparator = dot; + context.InputDecimalSeparator = dot; return numberStr; } else { - _inputUsesGroupSeparators = true; + context.InputUsesGroupSeparators = true; return numberStr.Replace(dot, string.Empty); } } else { - _inputDecimalSeparator = dot; + context.InputDecimalSeparator = dot; return numberStr; // Already in Mages-compatible format } } @@ -204,10 +211,10 @@ namespace Flow.Launcher.Plugin.Calculator return numberStr; } - private string FormatResult(decimal roundedResult) + private string FormatResult(decimal roundedResult, ParsingContext context) { // Use the detected decimal separator from the input; otherwise, fall back to settings. - string decimalSeparator = _inputDecimalSeparator ?? GetDecimalSeparator(); + string decimalSeparator = context.InputDecimalSeparator ?? GetDecimalSeparator(); string groupSeparator = decimalSeparator == dot ? comma : dot; string resultStr = roundedResult.ToString(CultureInfo.InvariantCulture); @@ -216,7 +223,7 @@ namespace Flow.Launcher.Plugin.Calculator string integerPart = parts[0]; string fractionalPart = parts.Length > 1 ? parts[1] : string.Empty; - if (_inputUsesGroupSeparators) + if (context.InputUsesGroupSeparators) { integerPart = ThousandGroupRegex.Replace(integerPart, groupSeparator); } From 5161bbe660a5dce00034ed4cec77f12a59d71a06 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Wed, 23 Jul 2025 09:33:14 +0800 Subject: [PATCH 03/15] Remove unused comments & blank line --- .../Views/CalculatorSettings.xaml.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs index 117a19b25..d0d79cd72 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs @@ -1,11 +1,8 @@ -using System.Windows.Controls; +using System.Windows.Controls; using Flow.Launcher.Plugin.Calculator.ViewModels; namespace Flow.Launcher.Plugin.Calculator.Views { - /// - /// Interaction logic for CalculatorSettings.xaml - /// public partial class CalculatorSettings : UserControl { private readonly SettingsViewModel _viewModel; @@ -19,5 +16,4 @@ namespace Flow.Launcher.Plugin.Calculator.Views InitializeComponent(); } } - } From 5ff8a5b1d59dd95ae8c0a79decb2714ee38e9cf8 Mon Sep 17 00:00:00 2001 From: Jack Ye <1160210343@qq.com> Date: Wed, 23 Jul 2025 09:59:09 +0800 Subject: [PATCH 04/15] Use compiled regex Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 2894c2159..b972394a4 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -24,7 +24,7 @@ namespace Flow.Launcher.Plugin.Calculator @"[ei]|[0-9]|0x[\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" + @")+$", RegexOptions.Compiled); private static readonly Regex RegBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled); - private static readonly Regex ThousandGroupRegex = new Regex(@"\B(?=(\d{3})+(?!\d))"); + private static readonly Regex ThousandGroupRegex = new Regex(@"\B(?=(\d{3})+(?!\d))", RegexOptions.Compiled); private static readonly Regex NumberRegex = new Regex(@"[\d\.,]+", RegexOptions.Compiled); private static Engine MagesEngine; From 852b2f517be223e3a9be419ea61271a7eefd6206 Mon Sep 17 00:00:00 2001 From: dcog989 Date: Wed, 23 Jul 2025 04:27:19 +0100 Subject: [PATCH 05/15] fix for regression from first review, plus issues with e.g. '0,123' and ',123' --- Flow.Launcher.Core/packages.lock.json | 84 ++-- .../packages.lock.json | 59 ++- Flow.Launcher.Plugin/packages.lock.json | 6 +- Flow.Launcher/packages.lock.json | 361 ++++++++++++++---- .../Flow.Launcher.Plugin.Calculator/Main.cs | 116 +++--- 5 files changed, 439 insertions(+), 187 deletions(-) diff --git a/Flow.Launcher.Core/packages.lock.json b/Flow.Launcher.Core/packages.lock.json index 0c513951b..dec7bf0b4 100644 --- a/Flow.Launcher.Core/packages.lock.json +++ b/Flow.Launcher.Core/packages.lock.json @@ -13,9 +13,9 @@ }, "FSharp.Core": { "type": "Direct", - "requested": "[9.0.101, )", - "resolved": "9.0.101", - "contentHash": "3/YR1SDWFA+Ojx9HiBwND+0UR8ZWoeZfkhD0DWAPCDdr/YI+CyFkArmMGzGSyPXeYtjG0sy0emzfyNwjt7zhig==" + "requested": "[9.0.201, )", + "resolved": "9.0.201", + "contentHash": "Ozq4T0ISTkqTYJ035XW/JkdDDaXofbykvfyVwkjLSqaDZ/4uNXfpf92cjcMI9lf9CxWqmlWHScViPh/4AvnWcw==" }, "Meziantou.Framework.Win32.Jobs": { "type": "Direct", @@ -29,6 +29,12 @@ "resolved": "3.0.1", "contentHash": "s/s20YTVY9r9TPfTrN5g8zPF1YhwxyqO6PxUkrYTGI2B+OGPe9AdajWZrLhFqXIvqIW23fnUE4+ztrUWNU1+9g==" }, + "SemanticVersioning": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "RR+8GbPQ/gjDqov/1QN1OPoUlbUruNwcL3WjWCeLw+MY7+od/ENhnkYxCfAC6rQLIu3QifaJt3kPYyP3RumqMQ==" + }, "squirrel.windows": { "type": "Direct", "requested": "[1.5.2, )", @@ -42,9 +48,9 @@ }, "StreamJsonRpc": { "type": "Direct", - "requested": "[2.20.20, )", - "resolved": "2.20.20", - "contentHash": "gwG7KViLbSWS7EI0kYevinVmIga9wZNrpSY/FnWyC6DbdjKJ1xlv/FV1L9b0rLkVP8cGxfIMexdvo/+2W5eq6Q==", + "requested": "[2.21.10, )", + "resolved": "2.21.10", + "contentHash": "wjBlFiaE+npUco9Jj4K11EEZfmAg4poRFYhcCJOiVdiHZ3UxapbGemtLNRcVYGXa/p8nqvZ38TfJPHnlrromDg==", "dependencies": { "MessagePack": "2.5.187", "Microsoft.VisualStudio.Threading": "17.10.48", @@ -78,6 +84,11 @@ "resolved": "1.0.0", "contentHash": "nwbZAYd+DblXAIzlnwDSnl0CiCm8jWLfHSYnoN4wYhtIav6AegB3+T/vKzLbU2IZlPB8Bvl8U3NXpx3eaz+N5w==" }, + "InputSimulator": { + "type": "Transitive", + "resolved": "1.0.4", + "contentHash": "D0LvRCPQMX6/FJHBjng+RO+wRDuHTJrfo7IAc7rmkPvRqchdVGJWg3y70peOtDy3OLNK+HSOwVkH4GiuLnkKgA==" + }, "JetBrains.Annotations": { "type": "Transitive", "resolved": "2024.3.0", @@ -85,22 +96,22 @@ }, "MemoryPack": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "cwCtED8y400vMWx/Vp0QCSeEpVFjDU4JwF52VX9WTaqVERUvNqjG9n6osFlmFuytegyXnHvYEu1qRJ8rv/rkbg==", + "resolved": "1.21.4", + "contentHash": "wy3JTBNBsO8LfQcBvvYsWr3lm2Oakolrfu0UQ3oSJSEiD+7ye0GUhYTaXuYYBowqsXBXWD9gf2218ae0JRiYVQ==", "dependencies": { - "MemoryPack.Core": "1.21.3", - "MemoryPack.Generator": "1.21.3" + "MemoryPack.Core": "1.21.4", + "MemoryPack.Generator": "1.21.4" } }, "MemoryPack.Core": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "ajrYoBWT2aKeH4tlY8q/1C9qK1R/NK+7FkuVOX58ebOSxkABoFTqCR7W+Zk2rakUHZiEgNdRqO67hiRZPq6fLA==" + "resolved": "1.21.4", + "contentHash": "6RszGorZ0ejNmp37ZcboPBMvvPCuNW2jlrdQfcs/lMzE5b3pmPF6hsm/laDc34hRlbAST1ZxaX/DvYu2DF5sBQ==" }, "MemoryPack.Generator": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "hYU0TAIarDKnbkNIWvb7P4zBUL+CTahkuNkczsKvycSMR5kiwQ4IfLexywNKX3s05Izp4gzDSPbueepNWZRpWA==" + "resolved": "1.21.4", + "contentHash": "g14EsSS85yn0lHTi0J9ivqlZMf09A2iI51fmI+0KkzIzyCbWOBWPi5mdaY7YWmXprk12aYh9u/qfWHQUYthlwg==" }, "MessagePack": { "type": "Transitive", @@ -142,8 +153,8 @@ }, "Microsoft.Win32.SystemEvents": { "type": "Transitive", - "resolved": "9.0.2", - "contentHash": "5BkGZ6mHp2dHydR29sb0fDfAuqkv30AHtTih8wMzvPZysOmBFvHfnkR2w3tsc0pSiIg8ZoKyefJXWy9r3pBh0w==" + "resolved": "7.0.0", + "contentHash": "2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==" }, "Mono.Cecil": { "type": "Transitive", @@ -165,18 +176,28 @@ "resolved": "13.0.1", "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" }, + "NHotkey": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "IEghs0QqWsQYH0uUmvIl0Ye6RaebWRh38eB6ToOkDnQucTYRGFOgtig0gSxlwCszTilYFz3n1ZuY762x+kDR3A==" + }, + "NHotkey.Wpf": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "BIUKlhTG5KtFf9OQzWvkmVmktt5/FFj6AOEgag8Uf0R2YdZt5ajUzs3sVskcJcT2TztWlEHKQr1jFj3KQ0D9Nw==", + "dependencies": { + "NHotkey": "3.0.0" + } + }, "NLog": { "type": "Transitive", "resolved": "4.7.10", "contentHash": "rcegW7kYOCjl7wX0SzsqpPBqnJ51JKi1WkYb6QBVX0Wc5IgH19Pv4t/co+T0s06OS0Ne44xgkY/mHg0PdrmJow==" }, - "PropertyChanged.Fody": { + "SharpVectors.Wpf": { "type": "Transitive", - "resolved": "3.4.0", - "contentHash": "IAZyq0uolKo2WYm4mjx+q7A8fSGFT0x2e1s3y+ODn4JI0kqTDoo9GF2tdaypUzRFJZfdMxfC5HZW9QzdJLtOnA==", - "dependencies": { - "Fody": "6.5.1" - } + "resolved": "1.8.4.2", + "contentHash": "PNxLkMBJnV8A+6yH9OqOlhLJegvWP/dvh0rAJp2l0kcrR+rB4R2tQ9vhUqka+UilH4atN8T6zvjDOizVyfz2Ng==" }, "Splat": { "type": "Transitive", @@ -185,10 +206,10 @@ }, "System.Drawing.Common": { "type": "Transitive", - "resolved": "9.0.2", - "contentHash": "JU947wzf8JbBS16Y5EIZzAlyQU+k68D7LRx6y03s2wlhlvLqkt/8uPBrjv2hJnnaJKbdb0GhQ3JZsfYXhrRjyg==", + "resolved": "7.0.0", + "contentHash": "KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==", "dependencies": { - "Microsoft.Win32.SystemEvents": "9.0.2" + "Microsoft.Win32.SystemEvents": "7.0.0" } }, "System.IO.Pipelines": { @@ -217,20 +238,21 @@ "Ben.Demystifier": "[0.4.1, )", "BitFaster.Caching": "[2.5.3, )", "CommunityToolkit.Mvvm": "[8.4.0, )", - "Flow.Launcher.Plugin": "[4.4.0, )", - "MemoryPack": "[1.21.3, )", + "Flow.Launcher.Plugin": "[4.7.0, )", + "InputSimulator": "[1.0.4, )", + "MemoryPack": "[1.21.4, )", "Microsoft.VisualStudio.Threading": "[17.12.19, )", + "NHotkey.Wpf": "[3.0.0, )", "NLog": "[4.7.10, )", - "PropertyChanged.Fody": "[3.4.0, )", - "System.Drawing.Common": "[9.0.2, )", + "SharpVectors.Wpf": "[1.8.4.2, )", + "System.Drawing.Common": "[7.0.0, )", "ToolGood.Words.Pinyin": "[3.0.1.4, )" } }, "flow.launcher.plugin": { "type": "Project", "dependencies": { - "JetBrains.Annotations": "[2024.3.0, )", - "PropertyChanged.Fody": "[3.4.0, )" + "JetBrains.Annotations": "[2024.3.0, )" } } } diff --git a/Flow.Launcher.Infrastructure/packages.lock.json b/Flow.Launcher.Infrastructure/packages.lock.json index f38f91ef9..27dfd1cd6 100644 --- a/Flow.Launcher.Infrastructure/packages.lock.json +++ b/Flow.Launcher.Infrastructure/packages.lock.json @@ -29,14 +29,20 @@ "resolved": "6.5.5", "contentHash": "Krca41L/PDva1VsmDec5n52cQZxQAQp/bsHdzsNi8iLLI0lqKL94fNIkNaC8tVolUkCyWsbzvxfxJCeD2789fA==" }, + "InputSimulator": { + "type": "Direct", + "requested": "[1.0.4, )", + "resolved": "1.0.4", + "contentHash": "D0LvRCPQMX6/FJHBjng+RO+wRDuHTJrfo7IAc7rmkPvRqchdVGJWg3y70peOtDy3OLNK+HSOwVkH4GiuLnkKgA==" + }, "MemoryPack": { "type": "Direct", - "requested": "[1.21.3, )", - "resolved": "1.21.3", - "contentHash": "cwCtED8y400vMWx/Vp0QCSeEpVFjDU4JwF52VX9WTaqVERUvNqjG9n6osFlmFuytegyXnHvYEu1qRJ8rv/rkbg==", + "requested": "[1.21.4, )", + "resolved": "1.21.4", + "contentHash": "wy3JTBNBsO8LfQcBvvYsWr3lm2Oakolrfu0UQ3oSJSEiD+7ye0GUhYTaXuYYBowqsXBXWD9gf2218ae0JRiYVQ==", "dependencies": { - "MemoryPack.Core": "1.21.3", - "MemoryPack.Generator": "1.21.3" + "MemoryPack.Core": "1.21.4", + "MemoryPack.Generator": "1.21.4" } }, "Microsoft.VisualStudio.Threading": { @@ -60,6 +66,15 @@ "Microsoft.Windows.WDK.Win32Metadata": "0.11.4-experimental" } }, + "NHotkey.Wpf": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "BIUKlhTG5KtFf9OQzWvkmVmktt5/FFj6AOEgag8Uf0R2YdZt5ajUzs3sVskcJcT2TztWlEHKQr1jFj3KQ0D9Nw==", + "dependencies": { + "NHotkey": "3.0.0" + } + }, "NLog": { "type": "Direct", "requested": "[4.7.10, )", @@ -75,13 +90,19 @@ "Fody": "6.5.1" } }, + "SharpVectors.Wpf": { + "type": "Direct", + "requested": "[1.8.4.2, )", + "resolved": "1.8.4.2", + "contentHash": "PNxLkMBJnV8A+6yH9OqOlhLJegvWP/dvh0rAJp2l0kcrR+rB4R2tQ9vhUqka+UilH4atN8T6zvjDOizVyfz2Ng==" + }, "System.Drawing.Common": { "type": "Direct", - "requested": "[9.0.2, )", - "resolved": "9.0.2", - "contentHash": "JU947wzf8JbBS16Y5EIZzAlyQU+k68D7LRx6y03s2wlhlvLqkt/8uPBrjv2hJnnaJKbdb0GhQ3JZsfYXhrRjyg==", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==", "dependencies": { - "Microsoft.Win32.SystemEvents": "9.0.2" + "Microsoft.Win32.SystemEvents": "7.0.0" } }, "ToolGood.Words.Pinyin": { @@ -97,13 +118,13 @@ }, "MemoryPack.Core": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "ajrYoBWT2aKeH4tlY8q/1C9qK1R/NK+7FkuVOX58ebOSxkABoFTqCR7W+Zk2rakUHZiEgNdRqO67hiRZPq6fLA==" + "resolved": "1.21.4", + "contentHash": "6RszGorZ0ejNmp37ZcboPBMvvPCuNW2jlrdQfcs/lMzE5b3pmPF6hsm/laDc34hRlbAST1ZxaX/DvYu2DF5sBQ==" }, "MemoryPack.Generator": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "hYU0TAIarDKnbkNIWvb7P4zBUL+CTahkuNkczsKvycSMR5kiwQ4IfLexywNKX3s05Izp4gzDSPbueepNWZRpWA==" + "resolved": "1.21.4", + "contentHash": "g14EsSS85yn0lHTi0J9ivqlZMf09A2iI51fmI+0KkzIzyCbWOBWPi5mdaY7YWmXprk12aYh9u/qfWHQUYthlwg==" }, "Microsoft.VisualStudio.Threading.Analyzers": { "type": "Transitive", @@ -117,8 +138,8 @@ }, "Microsoft.Win32.SystemEvents": { "type": "Transitive", - "resolved": "9.0.2", - "contentHash": "5BkGZ6mHp2dHydR29sb0fDfAuqkv30AHtTih8wMzvPZysOmBFvHfnkR2w3tsc0pSiIg8ZoKyefJXWy9r3pBh0w==" + "resolved": "7.0.0", + "contentHash": "2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==" }, "Microsoft.Windows.SDK.Win32Docs": { "type": "Transitive", @@ -138,6 +159,11 @@ "Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview" } }, + "NHotkey": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "IEghs0QqWsQYH0uUmvIl0Ye6RaebWRh38eB6ToOkDnQucTYRGFOgtig0gSxlwCszTilYFz3n1ZuY762x+kDR3A==" + }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "5.0.0", @@ -146,8 +172,7 @@ "flow.launcher.plugin": { "type": "Project", "dependencies": { - "JetBrains.Annotations": "[2024.3.0, )", - "PropertyChanged.Fody": "[3.4.0, )" + "JetBrains.Annotations": "[2024.3.0, )" } } } diff --git a/Flow.Launcher.Plugin/packages.lock.json b/Flow.Launcher.Plugin/packages.lock.json index 6cdf96e07..aad21a318 100644 --- a/Flow.Launcher.Plugin/packages.lock.json +++ b/Flow.Launcher.Plugin/packages.lock.json @@ -4,9 +4,9 @@ "net9.0-windows7.0": { "Fody": { "type": "Direct", - "requested": "[6.5.4, )", - "resolved": "6.5.4", - "contentHash": "GXZuti428IZctfby10xkMbWLCibcb6s29I/psLbBoO2vHJI5eTNVybnlV/Wi1tlIu9GG0bgW/PQwMH+MCldHxw==" + "requested": "[6.5.5, )", + "resolved": "6.5.5", + "contentHash": "Krca41L/PDva1VsmDec5n52cQZxQAQp/bsHdzsNi8iLLI0lqKL94fNIkNaC8tVolUkCyWsbzvxfxJCeD2789fA==" }, "JetBrains.Annotations": { "type": "Direct", diff --git a/Flow.Launcher/packages.lock.json b/Flow.Launcher/packages.lock.json index 017065044..f0409c131 100644 --- a/Flow.Launcher/packages.lock.json +++ b/Flow.Launcher/packages.lock.json @@ -16,25 +16,57 @@ }, "Fody": { "type": "Direct", - "requested": "[6.5.4, )", - "resolved": "6.5.4", - "contentHash": "GXZuti428IZctfby10xkMbWLCibcb6s29I/psLbBoO2vHJI5eTNVybnlV/Wi1tlIu9GG0bgW/PQwMH+MCldHxw==" + "requested": "[6.5.5, )", + "resolved": "6.5.5", + "contentHash": "Krca41L/PDva1VsmDec5n52cQZxQAQp/bsHdzsNi8iLLI0lqKL94fNIkNaC8tVolUkCyWsbzvxfxJCeD2789fA==" }, - "InputSimulator": { + "MdXaml": { "type": "Direct", - "requested": "[1.0.4, )", - "resolved": "1.0.4", - "contentHash": "D0LvRCPQMX6/FJHBjng+RO+wRDuHTJrfo7IAc7rmkPvRqchdVGJWg3y70peOtDy3OLNK+HSOwVkH4GiuLnkKgA==" - }, - "Jack251970.TaskScheduler": { - "type": "Direct", - "requested": "[2.12.1, )", - "resolved": "2.12.1", - "contentHash": "+epAtsLMugiznJCNRYCYB6eBcr+bx+CVlwPWMprO5CbnNkWu9mlSV8XN5BQJrGYwmlAtlGfZA3p3PcFFlrgR6A==", + "requested": "[1.27.0, )", + "resolved": "1.27.0", + "contentHash": "VWhqhCeKVkJe8vkPmXuGZlRX01WDrTugOLeUvJn18jH/8DrGGVBvtgIlJoELHD2f1DiEWqF3lxxjV55vnzE7Tg==", "dependencies": { - "Microsoft.Win32.Registry": "5.0.0", - "System.Diagnostics.EventLog": "8.0.0", - "System.Security.AccessControl": "6.0.1" + "AvalonEdit": "6.3.0.90", + "MdXaml.Plugins": "1.27.0" + } + }, + "MdXaml.AnimatedGif": { + "type": "Direct", + "requested": "[1.27.0, )", + "resolved": "1.27.0", + "contentHash": "Xrr9IgyAfqDbruqCp2Wxzthbc87QMvMR2YXQsGDyacLtowleefP1Jt3cesZCbI44YcZTGjyJNIkvRAyzzlgsOQ==", + "dependencies": { + "MdXaml.Plugins": "1.27.0", + "WpfAnimatedGif": "2.0.2" + } + }, + "MdXaml.Html": { + "type": "Direct", + "requested": "[1.27.0, )", + "resolved": "1.27.0", + "contentHash": "3AI0g7EwsTuvhhNd9bjb3J7v5aXFk1dLaf1CNbLjkcZs/MwnEUHNgzF+sLQBYYVdG2DqfV1BsuFoPWSG7IdHvg==", + "dependencies": { + "AvalonEdit": "6.3.0.90", + "HtmlAgilityPack": "1.11.42", + "MdXaml": "1.27.0", + "MdXaml.Plugins": "1.27.0" + } + }, + "MdXaml.Plugins": { + "type": "Direct", + "requested": "[1.27.0, )", + "resolved": "1.27.0", + "contentHash": "We7LtBdoukRg9mqTfa1f5n8z/GQPMKBRj3URk9DiMuqzIHkW1lTgK5njVPSScxsRt4YzW22423tSnLWNm2MJKg==" + }, + "MdXaml.Svg": { + "type": "Direct", + "requested": "[1.27.0, )", + "resolved": "1.27.0", + "contentHash": "zHtzcQrEVDoTDRvxFAccAIQG3UHCUW2cdWrGCg9yfT6344hhqc6d9t/93kBqQ6j+f580YeevtMeraz9PWmzpfw==", + "dependencies": { + "MdXaml": "1.27.0", + "MdXaml.Plugins": "1.27.0", + "Svg": "3.0.84" } }, "Microsoft.Extensions.DependencyInjection": { @@ -88,32 +120,12 @@ "System.ValueTuple": "4.5.0" } }, - "Microsoft.Windows.CsWin32": { - "type": "Direct", - "requested": "[0.3.106, )", - "resolved": "0.3.106", - "contentHash": "Mx5fK7uN6fwLR4wUghs6//HonAnwPBNmC2oonyJVhCUlHS/r6SUS3NkBc3+gaQiv+0/9bqdj1oSCKQFkNI+21Q==", - "dependencies": { - "Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha", - "Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview", - "Microsoft.Windows.WDK.Win32Metadata": "0.11.4-experimental" - } - }, "ModernWpfUI": { "type": "Direct", "requested": "[0.9.4, )", "resolved": "0.9.4", "contentHash": "HJ07Be9KOiGKGcMLz/AwY+84h3yGHRPuYpYXCE6h1yPtaFwGMWfanZ70jX7W5XWx8+Qk1vGox+WGKgxxsy6EHw==" }, - "NHotkey.Wpf": { - "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "BIUKlhTG5KtFf9OQzWvkmVmktt5/FFj6AOEgag8Uf0R2YdZt5ajUzs3sVskcJcT2TztWlEHKQr1jFj3KQ0D9Nw==", - "dependencies": { - "NHotkey": "3.0.0" - } - }, "PropertyChanged.Fody": { "type": "Direct", "requested": "[3.4.0, )", @@ -129,12 +141,28 @@ "resolved": "3.0.0", "contentHash": "RR+8GbPQ/gjDqov/1QN1OPoUlbUruNwcL3WjWCeLw+MY7+od/ENhnkYxCfAC6rQLIu3QifaJt3kPYyP3RumqMQ==" }, + "TaskScheduler": { + "type": "Direct", + "requested": "[2.12.1, )", + "resolved": "2.12.1", + "contentHash": "DzSVmVs0i5yHmuDy9ZMcTtKg48GU0aEFBbhp2XJrzA4saTRec/KbU5aGE/4P4FE499G3PDx9KPOHysoKzS/i3g==", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0", + "System.Diagnostics.EventLog": "9.0.2", + "System.Security.AccessControl": "6.0.1" + } + }, "VirtualizingWrapPanel": { "type": "Direct", "requested": "[2.1.1, )", "resolved": "2.1.1", "contentHash": "Fc/yjU8jqC3qpIsNxeO5RjK2lPU7xnJtBLMSQ6L9egA2PyJLQeVeXpG8WBb5N1kN15rlJEYG8dHWJ5qUGgaNrg==" }, + "AvalonEdit": { + "type": "Transitive", + "resolved": "6.3.0.90", + "contentHash": "WVTb5MxwGqKdeasd3nG5udlV4t6OpvkFanziwI133K0/QJ5FvZmfzRQgpAjGTJhQfIA8GP7AzKQ3sTY9JOFk8Q==" + }, "Ben.Demystifier": { "type": "Transitive", "resolved": "0.4.1", @@ -161,10 +189,25 @@ "YamlDotNet": "9.1.0" } }, + "Fizzler": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "jH8KFyDJtgqLl3jZwbwgR3nA9dyebKPBgLwBx0bjPvxvvoCqHPD5IPedRGYzki8RYFpjxCFMlLtnNFPYq2OgmQ==" + }, "FSharp.Core": { "type": "Transitive", - "resolved": "9.0.101", - "contentHash": "3/YR1SDWFA+Ojx9HiBwND+0UR8ZWoeZfkhD0DWAPCDdr/YI+CyFkArmMGzGSyPXeYtjG0sy0emzfyNwjt7zhig==" + "resolved": "9.0.201", + "contentHash": "Ozq4T0ISTkqTYJ035XW/JkdDDaXofbykvfyVwkjLSqaDZ/4uNXfpf92cjcMI9lf9CxWqmlWHScViPh/4AvnWcw==" + }, + "HtmlAgilityPack": { + "type": "Transitive", + "resolved": "1.11.42", + "contentHash": "LDc1bEfF14EY2DZzak4xvzWvbpNXK3vi1u0KQbBpLUN4+cx/VrvXhgCAMSJhSU5vz0oMfW9JZIR20vj/PkDHPA==" + }, + "InputSimulator": { + "type": "Transitive", + "resolved": "1.0.4", + "contentHash": "D0LvRCPQMX6/FJHBjng+RO+wRDuHTJrfo7IAc7rmkPvRqchdVGJWg3y70peOtDy3OLNK+HSOwVkH4GiuLnkKgA==" }, "JetBrains.Annotations": { "type": "Transitive", @@ -173,22 +216,22 @@ }, "MemoryPack": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "cwCtED8y400vMWx/Vp0QCSeEpVFjDU4JwF52VX9WTaqVERUvNqjG9n6osFlmFuytegyXnHvYEu1qRJ8rv/rkbg==", + "resolved": "1.21.4", + "contentHash": "wy3JTBNBsO8LfQcBvvYsWr3lm2Oakolrfu0UQ3oSJSEiD+7ye0GUhYTaXuYYBowqsXBXWD9gf2218ae0JRiYVQ==", "dependencies": { - "MemoryPack.Core": "1.21.3", - "MemoryPack.Generator": "1.21.3" + "MemoryPack.Core": "1.21.4", + "MemoryPack.Generator": "1.21.4" } }, "MemoryPack.Core": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "ajrYoBWT2aKeH4tlY8q/1C9qK1R/NK+7FkuVOX58ebOSxkABoFTqCR7W+Zk2rakUHZiEgNdRqO67hiRZPq6fLA==" + "resolved": "1.21.4", + "contentHash": "6RszGorZ0ejNmp37ZcboPBMvvPCuNW2jlrdQfcs/lMzE5b3pmPF6hsm/laDc34hRlbAST1ZxaX/DvYu2DF5sBQ==" }, "MemoryPack.Generator": { "type": "Transitive", - "resolved": "1.21.3", - "contentHash": "hYU0TAIarDKnbkNIWvb7P4zBUL+CTahkuNkczsKvycSMR5kiwQ4IfLexywNKX3s05Izp4gzDSPbueepNWZRpWA==" + "resolved": "1.21.4", + "contentHash": "g14EsSS85yn0lHTi0J9ivqlZMf09A2iI51fmI+0KkzIzyCbWOBWPi5mdaY7YWmXprk12aYh9u/qfWHQUYthlwg==" }, "MessagePack": { "type": "Transitive", @@ -440,6 +483,16 @@ "resolved": "17.6.3", "contentHash": "N0ZIanl1QCgvUumEL1laasU0a7sOE5ZwLZVTn0pAePnfhq8P7SvTjF8Axq+CnavuQkmdQpGNXQ1efZtu5kDFbA==" }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.NETCore.Targets": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + }, "Microsoft.VisualStudio.Threading": { "type": "Transitive", "resolved": "17.12.19", @@ -470,26 +523,8 @@ }, "Microsoft.Win32.SystemEvents": { "type": "Transitive", - "resolved": "9.0.2", - "contentHash": "5BkGZ6mHp2dHydR29sb0fDfAuqkv30AHtTih8wMzvPZysOmBFvHfnkR2w3tsc0pSiIg8ZoKyefJXWy9r3pBh0w==" - }, - "Microsoft.Windows.SDK.Win32Docs": { - "type": "Transitive", - "resolved": "0.1.42-alpha", - "contentHash": "Z/9po23gUA9aoukirh2ItMU2ZS9++Js9Gdds9fu5yuMojDrmArvY2y+tq9985tR3cxFxpZO1O35Wjfo0khj5HA==" - }, - "Microsoft.Windows.SDK.Win32Metadata": { - "type": "Transitive", - "resolved": "60.0.34-preview", - "contentHash": "TA3DUNi4CTeo+ItTXBnGZFt2159XOGSl0UOlG5vjDj4WHqZjhwYyyUnzOtrbCERiSaP2Hzg7otJNWwOSZgutyA==" - }, - "Microsoft.Windows.WDK.Win32Metadata": { - "type": "Transitive", - "resolved": "0.11.4-experimental", - "contentHash": "bf5MCmUyZf0gBlYQjx9UpRAZWBkRndyt9XicR+UNLvAUAFTZQbu6YaX/sNKZlR98Grn0gydfh/yT4I3vc0AIQA==", - "dependencies": { - "Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview" - } + "resolved": "7.0.0", + "contentHash": "2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==" }, "Mono.Cecil": { "type": "Transitive", @@ -516,11 +551,29 @@ "resolved": "3.0.0", "contentHash": "IEghs0QqWsQYH0uUmvIl0Ye6RaebWRh38eB6ToOkDnQucTYRGFOgtig0gSxlwCszTilYFz3n1ZuY762x+kDR3A==" }, + "NHotkey.Wpf": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "BIUKlhTG5KtFf9OQzWvkmVmktt5/FFj6AOEgag8Uf0R2YdZt5ajUzs3sVskcJcT2TztWlEHKQr1jFj3KQ0D9Nw==", + "dependencies": { + "NHotkey": "3.0.0" + } + }, "NLog": { "type": "Transitive", "resolved": "4.7.10", "contentHash": "rcegW7kYOCjl7wX0SzsqpPBqnJ51JKi1WkYb6QBVX0Wc5IgH19Pv4t/co+T0s06OS0Ne44xgkY/mHg0PdrmJow==" }, + "runtime.osx.10.10-x64.CoreCompat.System.Drawing": { + "type": "Transitive", + "resolved": "5.8.64", + "contentHash": "Ey7xQgWwixxdrmhzEUvaR4kxZDSQMWQScp8ViLvmL5xCBKG6U3TaMv/jzHilpfQXpHmJ4IylKGzzMvnYX2FwHQ==" + }, + "SharpVectors.Wpf": { + "type": "Transitive", + "resolved": "1.8.4.2", + "contentHash": "PNxLkMBJnV8A+6yH9OqOlhLJegvWP/dvh0rAJp2l0kcrR+rB4R2tQ9vhUqka+UilH4atN8T6zvjDOizVyfz2Ng==" + }, "Splat": { "type": "Transitive", "resolved": "1.6.2", @@ -538,8 +591,8 @@ }, "StreamJsonRpc": { "type": "Transitive", - "resolved": "2.20.20", - "contentHash": "gwG7KViLbSWS7EI0kYevinVmIga9wZNrpSY/FnWyC6DbdjKJ1xlv/FV1L9b0rLkVP8cGxfIMexdvo/+2W5eq6Q==", + "resolved": "2.21.10", + "contentHash": "wjBlFiaE+npUco9Jj4K11EEZfmAg4poRFYhcCJOiVdiHZ3UxapbGemtLNRcVYGXa/p8nqvZ38TfJPHnlrromDg==", "dependencies": { "MessagePack": "2.5.187", "Microsoft.VisualStudio.Threading": "17.10.48", @@ -550,6 +603,37 @@ "System.IO.Pipelines": "8.0.0" } }, + "Svg": { + "type": "Transitive", + "resolved": "3.0.84", + "contentHash": "QI35/+zRerIuOTBAw0GhbEQhuesSd3nYha9ibgyv6ofe4XRpFSjaXyQJJGssaUVZaBb2vwMAFKqb5uWnTAB2Sg==", + "dependencies": { + "Fizzler": "1.1.0", + "System.Drawing.Common": "4.5.1", + "System.ObjectModel": "4.3.0", + "runtime.osx.10.10-x64.CoreCompat.System.Drawing": "5.8.64" + } + }, + "System.Collections": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Debug": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, "System.Diagnostics.DiagnosticSource": { "type": "Transitive", "resolved": "7.0.1", @@ -557,15 +641,37 @@ }, "System.Diagnostics.EventLog": { "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==" + "resolved": "9.0.2", + "contentHash": "i+Fe6Fpst/onydFLBGilCr/Eh9OFdlaTU/c3alPp6IbLZXQJOgpIu3l4MOnmsN8fDYq5nAyHSqNIJesc74Yw3Q==" }, "System.Drawing.Common": { "type": "Transitive", - "resolved": "9.0.2", - "contentHash": "JU947wzf8JbBS16Y5EIZzAlyQU+k68D7LRx6y03s2wlhlvLqkt/8uPBrjv2hJnnaJKbdb0GhQ3JZsfYXhrRjyg==", + "resolved": "7.0.0", + "contentHash": "KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==", "dependencies": { - "Microsoft.Win32.SystemEvents": "9.0.2" + "Microsoft.Win32.SystemEvents": "7.0.0" + } + }, + "System.Globalization": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.IO": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" } }, "System.IO.Pipelines": { @@ -573,6 +679,30 @@ "resolved": "8.0.0", "contentHash": "FHNOatmUq0sqJOkTx+UF/9YK1f180cnW5FVqnQMvYUN0elp6wFzbtPSiqbo1/ru8ICp43JM1i7kKkk6GsNGHlA==" }, + "System.ObjectModel": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Reflection": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, "System.Reflection.Emit": { "type": "Transitive", "resolved": "4.7.0", @@ -583,6 +713,37 @@ "resolved": "5.0.0", "contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==" }, + "System.Reflection.Primitives": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.ResourceManager": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, "System.Security.AccessControl": { "type": "Transitive", "resolved": "6.0.1", @@ -593,6 +754,16 @@ "resolved": "5.0.0", "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" }, + "System.Text.Encoding": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, "System.Text.Encodings.Web": { "type": "Transitive", "resolved": "7.0.0", @@ -606,6 +777,25 @@ "System.Text.Encodings.Web": "7.0.0" } }, + "System.Threading": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, "System.ValueTuple": { "type": "Transitive", "resolved": "4.5.0", @@ -616,6 +806,11 @@ "resolved": "3.0.1.4", "contentHash": "uQo97618y9yzLDxrnehPN+/tuiOlk5BqieEdwctHZOAS9miMXnHKgMFYVw8CSGXRglyTYXlrW7qtUlU7Fje5Ew==" }, + "WpfAnimatedGif": { + "type": "Transitive", + "resolved": "2.0.2", + "contentHash": "B0j9SqtThyHVTiOPvu6yR+39Te0g3o+7Jjb+qEm7+Iz1HRqbE5/4QV+ntHWOYYBPOUFr9x1mdzGl/EzWP+nKiA==" + }, "YamlDotNet": { "type": "Transitive", "resolved": "9.1.0", @@ -625,12 +820,13 @@ "type": "Project", "dependencies": { "Droplex": "[1.7.0, )", - "FSharp.Core": "[9.0.101, )", + "FSharp.Core": "[9.0.201, )", "Flow.Launcher.Infrastructure": "[1.0.0, )", - "Flow.Launcher.Plugin": "[4.4.0, )", + "Flow.Launcher.Plugin": "[4.7.0, )", "Meziantou.Framework.Win32.Jobs": "[3.4.0, )", "Microsoft.IO.RecyclableMemoryStream": "[3.0.1, )", - "StreamJsonRpc": "[2.20.20, )", + "SemanticVersioning": "[3.0.0, )", + "StreamJsonRpc": "[2.21.10, )", "squirrel.windows": "[1.5.2, )" } }, @@ -640,20 +836,21 @@ "Ben.Demystifier": "[0.4.1, )", "BitFaster.Caching": "[2.5.3, )", "CommunityToolkit.Mvvm": "[8.4.0, )", - "Flow.Launcher.Plugin": "[4.4.0, )", - "MemoryPack": "[1.21.3, )", + "Flow.Launcher.Plugin": "[4.7.0, )", + "InputSimulator": "[1.0.4, )", + "MemoryPack": "[1.21.4, )", "Microsoft.VisualStudio.Threading": "[17.12.19, )", + "NHotkey.Wpf": "[3.0.0, )", "NLog": "[4.7.10, )", - "PropertyChanged.Fody": "[3.4.0, )", - "System.Drawing.Common": "[9.0.2, )", + "SharpVectors.Wpf": "[1.8.4.2, )", + "System.Drawing.Common": "[7.0.0, )", "ToolGood.Words.Pinyin": "[3.0.1.4, )" } }, "flow.launcher.plugin": { "type": "Project", "dependencies": { - "JetBrains.Annotations": "[2024.3.0, )", - "PropertyChanged.Fody": "[3.4.0, )" + "JetBrains.Annotations": "[2024.3.0, )" } } } diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 2894c2159..afd0ddfe5 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -24,7 +24,7 @@ namespace Flow.Launcher.Plugin.Calculator @"[ei]|[0-9]|0x[\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" + @")+$", RegexOptions.Compiled); private static readonly Regex RegBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled); - private static readonly Regex ThousandGroupRegex = new Regex(@"\B(?=(\d{3})+(?!\d))"); + private static readonly Regex ThousandGroupRegex = new Regex(@"\B(?=(\d{3})+(?!\d))", RegexOptions.Compiled); private static readonly Regex NumberRegex = new Regex(@"[\d\.,]+", RegexOptions.Compiled); private static Engine MagesEngine; @@ -120,100 +120,108 @@ namespace Flow.Launcher.Plugin.Calculator return new List(); } - + /// /// Parses a string representation of a number, detecting its format. It uses structural analysis - /// (checking for 3-digit groups) and falls back to system culture for ambiguous cases (e.g., "1,234"). + /// and falls back to system culture for truly ambiguous cases (e.g., "1,234"). /// It populates the provided ParsingContext with the detected format for later use. /// /// A normalized number string with '.' as the decimal separator for the Mages engine. private string NormalizeNumber(string numberStr, ParsingContext context) { - var systemFormat = CultureInfo.CurrentCulture.NumberFormat; - string systemDecimalSeparator = systemFormat.NumberDecimalSeparator; + var systemGroupSep = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator; + int dotCount = numberStr.Count(f => f == '.'); + int commaCount = numberStr.Count(f => f == ','); - bool hasDot = numberStr.Contains(dot); - bool hasComma = numberStr.Contains(comma); - - // Unambiguous case: both separators are present. The last one wins as decimal separator. - if (hasDot && hasComma) + // Case 1: Unambiguous mixed separators (e.g., "1.234,56") + if (dotCount > 0 && commaCount > 0) { context.InputUsesGroupSeparators = true; - int lastDotPos = numberStr.LastIndexOf(dot); - int lastCommaPos = numberStr.LastIndexOf(comma); - - if (lastDotPos > lastCommaPos) // e.g. 1,234.56 + if (numberStr.LastIndexOf('.') > numberStr.LastIndexOf(',')) { context.InputDecimalSeparator = dot; return numberStr.Replace(comma, string.Empty); } - else // e.g. 1.234,56 + else { context.InputDecimalSeparator = comma; return numberStr.Replace(dot, string.Empty).Replace(comma, dot); } } - if (hasComma) + // Case 2: Only dots + if (dotCount > 0) { - string[] parts = numberStr.Split(','); - // If all parts after the first are 3 digits, it's a potential group separator. - bool isGroupCandidate = parts.Length > 1 && parts.Skip(1).All(p => p.Length == 3); - - if (isGroupCandidate) + if (dotCount > 1) { - // Ambiguous case: "1,234". Resolve using culture. - if (systemDecimalSeparator == comma) + context.InputUsesGroupSeparators = true; + return numberStr.Replace(dot, string.Empty); + } + // A number is ambiguous if it has a single dot in the thousands position, + // and does not start with a "0." or "." + bool isAmbiguous = numberStr.Length - numberStr.LastIndexOf('.') == 4 + && !numberStr.StartsWith("0.") + && !numberStr.StartsWith("."); + if (isAmbiguous) + { + if (systemGroupSep == dot) { - context.InputDecimalSeparator = comma; - return numberStr.Replace(comma, dot); + context.InputUsesGroupSeparators = true; + return numberStr.Replace(dot, string.Empty); } else + { + context.InputDecimalSeparator = dot; + return numberStr; + } + } + else // Unambiguous decimal (e.g., "12.34" or "0.123" or ".123") + { + context.InputDecimalSeparator = dot; + return numberStr; + } + } + + // Case 3: Only commas + if (commaCount > 0) + { + if (commaCount > 1) + { + context.InputUsesGroupSeparators = true; + return numberStr.Replace(comma, string.Empty); + } + // A number is ambiguous if it has a single comma in the thousands position, + // and does not start with a "0," or "," + bool isAmbiguous = numberStr.Length - numberStr.LastIndexOf(',') == 4 + && !numberStr.StartsWith("0,") + && !numberStr.StartsWith(","); + if (isAmbiguous) + { + if (systemGroupSep == comma) { context.InputUsesGroupSeparators = true; return numberStr.Replace(comma, string.Empty); } + else + { + context.InputDecimalSeparator = comma; + return numberStr.Replace(comma, dot); + } } - else + else // Unambiguous decimal (e.g., "12,34" or "0,123" or ",123") { - // Unambiguous decimal: "123,45" or "1,2,345" context.InputDecimalSeparator = comma; return numberStr.Replace(comma, dot); } } - if (hasDot) - { - string[] parts = numberStr.Split('.'); - bool isGroupCandidate = parts.Length > 1 && parts.Skip(1).All(p => p.Length == 3); - - if (isGroupCandidate) - { - if (systemDecimalSeparator == dot) - { - context.InputDecimalSeparator = dot; - return numberStr; - } - else - { - context.InputUsesGroupSeparators = true; - return numberStr.Replace(dot, string.Empty); - } - } - else - { - context.InputDecimalSeparator = dot; - return numberStr; // Already in Mages-compatible format - } - } - - // No separators. + // Case 4: No separators return numberStr; } + private string FormatResult(decimal roundedResult, ParsingContext context) { - // Use the detected decimal separator from the input; otherwise, fall back to settings. string decimalSeparator = context.InputDecimalSeparator ?? GetDecimalSeparator(); string groupSeparator = decimalSeparator == dot ? comma : dot; From cf40045acdc31740782c036e87d8593aaca681fd Mon Sep 17 00:00:00 2001 From: dcog989 <89043002+dcog989@users.noreply.github.com> Date: Wed, 23 Jul 2025 04:34:54 +0100 Subject: [PATCH 06/15] Delete Flow.Launcher.Core/packages.lock.json --- Flow.Launcher.Core/packages.lock.json | 260 -------------------------- 1 file changed, 260 deletions(-) delete mode 100644 Flow.Launcher.Core/packages.lock.json diff --git a/Flow.Launcher.Core/packages.lock.json b/Flow.Launcher.Core/packages.lock.json deleted file mode 100644 index dec7bf0b4..000000000 --- a/Flow.Launcher.Core/packages.lock.json +++ /dev/null @@ -1,260 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net9.0-windows7.0": { - "Droplex": { - "type": "Direct", - "requested": "[1.7.0, )", - "resolved": "1.7.0", - "contentHash": "wutfIus/Ufw/9TDsp86R1ycnIH+wWrj4UhcmrzAHWjsdyC2iM07WEQ9+APTB7pQynsDnYH1r2i58XgAJ3lxUXA==", - "dependencies": { - "YamlDotNet": "9.1.0" - } - }, - "FSharp.Core": { - "type": "Direct", - "requested": "[9.0.201, )", - "resolved": "9.0.201", - "contentHash": "Ozq4T0ISTkqTYJ035XW/JkdDDaXofbykvfyVwkjLSqaDZ/4uNXfpf92cjcMI9lf9CxWqmlWHScViPh/4AvnWcw==" - }, - "Meziantou.Framework.Win32.Jobs": { - "type": "Direct", - "requested": "[3.4.0, )", - "resolved": "3.4.0", - "contentHash": "5GGLckfpwoC1jznInEYfK2INrHyD7K1RtwZJ98kNPKBU6jeu24i4zfgDGHHfb+eK3J+eFPAxo0aYcbUxNXIbNw==" - }, - "Microsoft.IO.RecyclableMemoryStream": { - "type": "Direct", - "requested": "[3.0.1, )", - "resolved": "3.0.1", - "contentHash": "s/s20YTVY9r9TPfTrN5g8zPF1YhwxyqO6PxUkrYTGI2B+OGPe9AdajWZrLhFqXIvqIW23fnUE4+ztrUWNU1+9g==" - }, - "SemanticVersioning": { - "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "RR+8GbPQ/gjDqov/1QN1OPoUlbUruNwcL3WjWCeLw+MY7+od/ENhnkYxCfAC6rQLIu3QifaJt3kPYyP3RumqMQ==" - }, - "squirrel.windows": { - "type": "Direct", - "requested": "[1.5.2, )", - "resolved": "1.5.2", - "contentHash": "89Y/CFxWm7SEOjvuV2stVa8p+SNM9GOLk4tUNm2nUF792nfkimAgwRA/umVsdyd/OXBH8byXSh4V1qck88ZAyQ==", - "dependencies": { - "DeltaCompressionDotNet": "[1.0.0, 2.0.0)", - "Mono.Cecil": "0.9.6.1", - "Splat": "1.6.2" - } - }, - "StreamJsonRpc": { - "type": "Direct", - "requested": "[2.21.10, )", - "resolved": "2.21.10", - "contentHash": "wjBlFiaE+npUco9Jj4K11EEZfmAg4poRFYhcCJOiVdiHZ3UxapbGemtLNRcVYGXa/p8nqvZ38TfJPHnlrromDg==", - "dependencies": { - "MessagePack": "2.5.187", - "Microsoft.VisualStudio.Threading": "17.10.48", - "Microsoft.VisualStudio.Threading.Analyzers": "17.10.48", - "Microsoft.VisualStudio.Validation": "17.8.8", - "Nerdbank.Streams": "2.11.74", - "Newtonsoft.Json": "13.0.1", - "System.IO.Pipelines": "8.0.0" - } - }, - "Ben.Demystifier": { - "type": "Transitive", - "resolved": "0.4.1", - "contentHash": "axFeEMfmEORy3ipAzOXG/lE+KcNptRbei3F0C4kQCdeiQtW+qJW90K5iIovITGrdLt8AjhNCwk5qLSX9/rFpoA==", - "dependencies": { - "System.Reflection.Metadata": "5.0.0" - } - }, - "BitFaster.Caching": { - "type": "Transitive", - "resolved": "2.5.3", - "contentHash": "Vo/39qcam5Xe+DbyfH0JZyqPswdOoa7jv4PGtRJ6Wj8AU+aZ+TuJRlJcIe+MQjRTJwliI8k8VSQpN8sEoBIv2g==" - }, - "CommunityToolkit.Mvvm": { - "type": "Transitive", - "resolved": "8.4.0", - "contentHash": "tqVU8yc/ADO9oiTRyTnwhFN68hCwvkliMierptWOudIAvWY1mWCh5VFh+guwHJmpMwfg0J0rY+yyd5Oy7ty9Uw==" - }, - "DeltaCompressionDotNet": { - "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "nwbZAYd+DblXAIzlnwDSnl0CiCm8jWLfHSYnoN4wYhtIav6AegB3+T/vKzLbU2IZlPB8Bvl8U3NXpx3eaz+N5w==" - }, - "InputSimulator": { - "type": "Transitive", - "resolved": "1.0.4", - "contentHash": "D0LvRCPQMX6/FJHBjng+RO+wRDuHTJrfo7IAc7rmkPvRqchdVGJWg3y70peOtDy3OLNK+HSOwVkH4GiuLnkKgA==" - }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "MemoryPack": { - "type": "Transitive", - "resolved": "1.21.4", - "contentHash": "wy3JTBNBsO8LfQcBvvYsWr3lm2Oakolrfu0UQ3oSJSEiD+7ye0GUhYTaXuYYBowqsXBXWD9gf2218ae0JRiYVQ==", - "dependencies": { - "MemoryPack.Core": "1.21.4", - "MemoryPack.Generator": "1.21.4" - } - }, - "MemoryPack.Core": { - "type": "Transitive", - "resolved": "1.21.4", - "contentHash": "6RszGorZ0ejNmp37ZcboPBMvvPCuNW2jlrdQfcs/lMzE5b3pmPF6hsm/laDc34hRlbAST1ZxaX/DvYu2DF5sBQ==" - }, - "MemoryPack.Generator": { - "type": "Transitive", - "resolved": "1.21.4", - "contentHash": "g14EsSS85yn0lHTi0J9ivqlZMf09A2iI51fmI+0KkzIzyCbWOBWPi5mdaY7YWmXprk12aYh9u/qfWHQUYthlwg==" - }, - "MessagePack": { - "type": "Transitive", - "resolved": "2.5.187", - "contentHash": "uW4j8m4Nc+2Mk5n6arOChavJ9bLjkis0qWASOj2h2OwmfINuzYv+mjCHUymrYhmyyKTu3N+ObtTXAY4uQ7jIhg==", - "dependencies": { - "MessagePack.Annotations": "2.5.187", - "Microsoft.NET.StringTools": "17.6.3" - } - }, - "MessagePack.Annotations": { - "type": "Transitive", - "resolved": "2.5.187", - "contentHash": "/IvvMMS8opvlHjEJ/fR2Cal4Co726Kj77Z8KiohFhuHfLHHmb9uUxW5+tSCL4ToKFfkQlrS3HD638mRq83ySqA==" - }, - "Microsoft.NET.StringTools": { - "type": "Transitive", - "resolved": "17.6.3", - "contentHash": "N0ZIanl1QCgvUumEL1laasU0a7sOE5ZwLZVTn0pAePnfhq8P7SvTjF8Axq+CnavuQkmdQpGNXQ1efZtu5kDFbA==" - }, - "Microsoft.VisualStudio.Threading": { - "type": "Transitive", - "resolved": "17.12.19", - "contentHash": "eLiGMkMYyaSguqHs3lsrFxy3tAWSLuPEL2pIWRcADMDVAs2xqm3dr1d9QYjiEusTgiClF9KD6OB2NdZP72Oy0Q==", - "dependencies": { - "Microsoft.VisualStudio.Threading.Analyzers": "17.12.19", - "Microsoft.VisualStudio.Validation": "17.8.8" - } - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Transitive", - "resolved": "17.12.19", - "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" - }, - "Microsoft.VisualStudio.Validation": { - "type": "Transitive", - "resolved": "17.8.8", - "contentHash": "rWXThIpyQd4YIXghNkiv2+VLvzS+MCMKVRDR0GAMlflsdo+YcAN2g2r5U1Ah98OFjQMRexTFtXQQ2LkajxZi3g==" - }, - "Microsoft.Win32.SystemEvents": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "2nXPrhdAyAzir0gLl8Yy8S5Mnm/uBSQQA7jEsILOS1MTyS7DbmV1NgViMtvV1sfCD1ebITpNwb1NIinKeJgUVQ==" - }, - "Mono.Cecil": { - "type": "Transitive", - "resolved": "0.9.6.1", - "contentHash": "yMsurNaOxxKIjyW9pEB+tRrR1S3DFnN1+iBgKvYvXG8kW0Y6yknJeMAe/tl3+P78/2C6304TgF7aVqpqXgEQ9Q==" - }, - "Nerdbank.Streams": { - "type": "Transitive", - "resolved": "2.11.74", - "contentHash": "r4G7uHHfoo8LCilPOdtf2C+Q5ymHOAXtciT4ZtB2xRlAvv4gPkWBYNAijFblStv3+uidp81j5DP11jMZl4BfJw==", - "dependencies": { - "Microsoft.VisualStudio.Threading": "17.10.48", - "Microsoft.VisualStudio.Validation": "17.8.8", - "System.IO.Pipelines": "8.0.0" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "NHotkey": { - "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "IEghs0QqWsQYH0uUmvIl0Ye6RaebWRh38eB6ToOkDnQucTYRGFOgtig0gSxlwCszTilYFz3n1ZuY762x+kDR3A==" - }, - "NHotkey.Wpf": { - "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "BIUKlhTG5KtFf9OQzWvkmVmktt5/FFj6AOEgag8Uf0R2YdZt5ajUzs3sVskcJcT2TztWlEHKQr1jFj3KQ0D9Nw==", - "dependencies": { - "NHotkey": "3.0.0" - } - }, - "NLog": { - "type": "Transitive", - "resolved": "4.7.10", - "contentHash": "rcegW7kYOCjl7wX0SzsqpPBqnJ51JKi1WkYb6QBVX0Wc5IgH19Pv4t/co+T0s06OS0Ne44xgkY/mHg0PdrmJow==" - }, - "SharpVectors.Wpf": { - "type": "Transitive", - "resolved": "1.8.4.2", - "contentHash": "PNxLkMBJnV8A+6yH9OqOlhLJegvWP/dvh0rAJp2l0kcrR+rB4R2tQ9vhUqka+UilH4atN8T6zvjDOizVyfz2Ng==" - }, - "Splat": { - "type": "Transitive", - "resolved": "1.6.2", - "contentHash": "DeH0MxPU+D4JchkIDPYG4vUT+hsWs9S41cFle0/4K5EJMXWurx5DzAkj2366DfK14/XKNhsu6tCl4dZXJ3CD4w==" - }, - "System.Drawing.Common": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "KIX+oBU38pxkKPxvLcLfIkOV5Ien8ReN78wro7OF5/erwcmortzeFx+iBswlh2Vz6gVne0khocQudGwaO1Ey6A==", - "dependencies": { - "Microsoft.Win32.SystemEvents": "7.0.0" - } - }, - "System.IO.Pipelines": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "FHNOatmUq0sqJOkTx+UF/9YK1f180cnW5FVqnQMvYUN0elp6wFzbtPSiqbo1/ru8ICp43JM1i7kKkk6GsNGHlA==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==" - }, - "ToolGood.Words.Pinyin": { - "type": "Transitive", - "resolved": "3.0.1.4", - "contentHash": "uQo97618y9yzLDxrnehPN+/tuiOlk5BqieEdwctHZOAS9miMXnHKgMFYVw8CSGXRglyTYXlrW7qtUlU7Fje5Ew==" - }, - "YamlDotNet": { - "type": "Transitive", - "resolved": "9.1.0", - "contentHash": "fuvGXU4Ec5HrsmEc+BiFTNPCRf1cGBI2kh/3RzMWgddM2M4ALhbSPoI3X3mhXZUD1qqQd9oSkFAtWjpz8z9eRg==" - }, - "flow.launcher.infrastructure": { - "type": "Project", - "dependencies": { - "Ben.Demystifier": "[0.4.1, )", - "BitFaster.Caching": "[2.5.3, )", - "CommunityToolkit.Mvvm": "[8.4.0, )", - "Flow.Launcher.Plugin": "[4.7.0, )", - "InputSimulator": "[1.0.4, )", - "MemoryPack": "[1.21.4, )", - "Microsoft.VisualStudio.Threading": "[17.12.19, )", - "NHotkey.Wpf": "[3.0.0, )", - "NLog": "[4.7.10, )", - "SharpVectors.Wpf": "[1.8.4.2, )", - "System.Drawing.Common": "[7.0.0, )", - "ToolGood.Words.Pinyin": "[3.0.1.4, )" - } - }, - "flow.launcher.plugin": { - "type": "Project", - "dependencies": { - "JetBrains.Annotations": "[2024.3.0, )" - } - } - } - } -} \ No newline at end of file From 1fed54b615d7f1fb2a475801cd559157b3434769 Mon Sep 17 00:00:00 2001 From: dcog989 <89043002+dcog989@users.noreply.github.com> Date: Wed, 23 Jul 2025 04:35:18 +0100 Subject: [PATCH 07/15] Delete Flow.Launcher.Plugin/packages.lock.json --- Flow.Launcher.Plugin/packages.lock.json | 77 ------------------------- 1 file changed, 77 deletions(-) delete mode 100644 Flow.Launcher.Plugin/packages.lock.json diff --git a/Flow.Launcher.Plugin/packages.lock.json b/Flow.Launcher.Plugin/packages.lock.json deleted file mode 100644 index aad21a318..000000000 --- a/Flow.Launcher.Plugin/packages.lock.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net9.0-windows7.0": { - "Fody": { - "type": "Direct", - "requested": "[6.5.5, )", - "resolved": "6.5.5", - "contentHash": "Krca41L/PDva1VsmDec5n52cQZxQAQp/bsHdzsNi8iLLI0lqKL94fNIkNaC8tVolUkCyWsbzvxfxJCeD2789fA==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "Microsoft.SourceLink.GitHub": { - "type": "Direct", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" - } - }, - "Microsoft.Windows.CsWin32": { - "type": "Direct", - "requested": "[0.3.106, )", - "resolved": "0.3.106", - "contentHash": "Mx5fK7uN6fwLR4wUghs6//HonAnwPBNmC2oonyJVhCUlHS/r6SUS3NkBc3+gaQiv+0/9bqdj1oSCKQFkNI+21Q==", - "dependencies": { - "Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha", - "Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview", - "Microsoft.Windows.WDK.Win32Metadata": "0.11.4-experimental" - } - }, - "PropertyChanged.Fody": { - "type": "Direct", - "requested": "[3.4.0, )", - "resolved": "3.4.0", - "contentHash": "IAZyq0uolKo2WYm4mjx+q7A8fSGFT0x2e1s3y+ODn4JI0kqTDoo9GF2tdaypUzRFJZfdMxfC5HZW9QzdJLtOnA==", - "dependencies": { - "Fody": "6.5.1" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" - }, - "Microsoft.SourceLink.Common": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" - }, - "Microsoft.Windows.SDK.Win32Docs": { - "type": "Transitive", - "resolved": "0.1.42-alpha", - "contentHash": "Z/9po23gUA9aoukirh2ItMU2ZS9++Js9Gdds9fu5yuMojDrmArvY2y+tq9985tR3cxFxpZO1O35Wjfo0khj5HA==" - }, - "Microsoft.Windows.SDK.Win32Metadata": { - "type": "Transitive", - "resolved": "60.0.34-preview", - "contentHash": "TA3DUNi4CTeo+ItTXBnGZFt2159XOGSl0UOlG5vjDj4WHqZjhwYyyUnzOtrbCERiSaP2Hzg7otJNWwOSZgutyA==" - }, - "Microsoft.Windows.WDK.Win32Metadata": { - "type": "Transitive", - "resolved": "0.11.4-experimental", - "contentHash": "bf5MCmUyZf0gBlYQjx9UpRAZWBkRndyt9XicR+UNLvAUAFTZQbu6YaX/sNKZlR98Grn0gydfh/yT4I3vc0AIQA==", - "dependencies": { - "Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview" - } - } - } - } -} \ No newline at end of file From 4d22e6c352c4d1b70d6fe67b29ff0d3f201ecaae Mon Sep 17 00:00:00 2001 From: dcog989 <89043002+dcog989@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:26:18 +0100 Subject: [PATCH 08/15] Delete Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs --- .../Views/CalculatorSettings.xaml.cs | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs deleted file mode 100644 index d0d79cd72..000000000 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Windows.Controls; -using Flow.Launcher.Plugin.Calculator.ViewModels; - -namespace Flow.Launcher.Plugin.Calculator.Views -{ - public partial class CalculatorSettings : UserControl - { - private readonly SettingsViewModel _viewModel; - private readonly Settings _settings; - - public CalculatorSettings(SettingsViewModel viewModel) - { - _viewModel = viewModel; - _settings = viewModel.Settings; - DataContext = viewModel; - InitializeComponent(); - } - } -} From 76f834ff1b88fe09c2025cef55b7aa968e85f424 Mon Sep 17 00:00:00 2001 From: dcog989 Date: Wed, 23 Jul 2025 17:56:58 +0100 Subject: [PATCH 09/15] PR review changes --- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 15 +++++++++++---- .../Flow.Launcher.Plugin.Calculator/plugin.json | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index afd0ddfe5..e9ea2d08c 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -219,11 +219,10 @@ namespace Flow.Launcher.Plugin.Calculator return numberStr; } - private string FormatResult(decimal roundedResult, ParsingContext context) { string decimalSeparator = context.InputDecimalSeparator ?? GetDecimalSeparator(); - string groupSeparator = decimalSeparator == dot ? comma : dot; + string groupSeparator = GetGroupSeparator(decimalSeparator); string resultStr = roundedResult.ToString(CultureInfo.InvariantCulture); @@ -231,7 +230,7 @@ namespace Flow.Launcher.Plugin.Calculator string integerPart = parts[0]; string fractionalPart = parts.Length > 1 ? parts[1] : string.Empty; - if (context.InputUsesGroupSeparators) + if (context.InputUsesGroupSeparators && integerPart.Length > 3) { integerPart = ThousandGroupRegex.Replace(integerPart, groupSeparator); } @@ -244,9 +243,17 @@ namespace Flow.Launcher.Plugin.Calculator return integerPart; } + private string GetGroupSeparator(string decimalSeparator) + { + // Use system culture's group separator when available and it doesn't conflict + var systemGroupSep = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator; + return decimalSeparator == systemGroupSep + ? (decimalSeparator == dot ? comma : dot) + : systemGroupSep; + } + private bool CanCalculate(Query query) { - // Don't execute when user only input "e" or "i" keyword if (query.Search.Length < 2) { return false; diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index 739572930..c9435e043 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -4,7 +4,7 @@ "Name": "Calculator", "Description": "Perform mathematical calculations (including hexadecimal values). Use ',' or '.' as thousand separator or decimal place.", "Author": "cxfksword, dcog989", - "Version": "1.1.0", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Calculator.dll", From f8a6b02c80559d020437ebc166a18c8e88fd78d9 Mon Sep 17 00:00:00 2001 From: dcog989 Date: Thu, 24 Jul 2025 02:33:59 +0100 Subject: [PATCH 10/15] fix for GitHub build server failure Removes external dependency for NumberGroupSeparator so it builds anywhere. --- .../Flow.Launcher.Plugin.Calculator/Main.cs | 8 +++---- .../Views/CalculatorSettings.xaml.cs | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index e9ea2d08c..cc5032c6b 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -245,11 +245,9 @@ namespace Flow.Launcher.Plugin.Calculator private string GetGroupSeparator(string decimalSeparator) { - // Use system culture's group separator when available and it doesn't conflict - var systemGroupSep = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator; - return decimalSeparator == systemGroupSep - ? (decimalSeparator == dot ? comma : dot) - : systemGroupSep; + // This logic is now independent of the system's group separator + // to ensure consistent output for unit testing. + return decimalSeparator == dot ? comma : dot; } private bool CanCalculate(Query query) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs new file mode 100644 index 000000000..64e2adc6e --- /dev/null +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs @@ -0,0 +1,23 @@ +using System.Windows.Controls; +using Flow.Launcher.Plugin.Calculator.ViewModels; + +namespace Flow.Launcher.Plugin.Calculator.Views +{ + /// + /// Interaction logic for CalculatorSettings.xaml + /// + public partial class CalculatorSettings : UserControl + { + private readonly SettingsViewModel _viewModel; + private readonly Settings _settings; + + public CalculatorSettings(SettingsViewModel viewModel) + { + _viewModel = viewModel; + _settings = viewModel.Settings; + DataContext = viewModel; + InitializeComponent(); + } + } + +} \ No newline at end of file From 443d4f7c02d0ea00eb593a9e7af12029100b2dd1 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 27 Jul 2025 18:39:38 +0800 Subject: [PATCH 11/15] Build regex at compile time --- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 5 ++--- Plugins/Flow.Launcher.Plugin.Calculator/MainRegexHelper.cs | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 78c182f30..0744024f4 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -15,9 +15,8 @@ namespace Flow.Launcher.Plugin.Calculator { private static readonly Regex RegValidExpressChar = MainRegexHelper.GetRegValidExpressChar(); private static readonly Regex RegBrackets = MainRegexHelper.GetRegBrackets(); - private static readonly Regex ThousandGroupRegex = new Regex(@"\B(?=(\d{3})+(?!\d))", RegexOptions.Compiled); - private static readonly Regex NumberRegex = new Regex(@"[\d\.,]+", RegexOptions.Compiled); - + private static readonly Regex ThousandGroupRegex = MainRegexHelper.GetThousandGroupRegex(); + private static readonly Regex NumberRegex = MainRegexHelper.GetNumberRegex(); private static Engine MagesEngine; private const string Comma = ","; diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/MainRegexHelper.cs b/Plugins/Flow.Launcher.Plugin.Calculator/MainRegexHelper.cs index 8ffc547d1..f4e2090e7 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/MainRegexHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/MainRegexHelper.cs @@ -10,4 +10,10 @@ internal static partial class MainRegexHelper [GeneratedRegex(@"^(ceil|floor|exp|pi|e|max|min|det|abs|log|ln|sqrt|sin|cos|tan|arcsin|arccos|arctan|eigval|eigvec|eig|sum|polar|plot|round|sort|real|zeta|bin2dec|hex2dec|oct2dec|factorial|sign|isprime|isinfty|==|~=|&&|\|\||(?:\<|\>)=?|[ei]|[0-9]|0x[\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]])+$", RegexOptions.Compiled)] public static partial Regex GetRegValidExpressChar(); + + [GeneratedRegex(@"[\d\.,]+", RegexOptions.Compiled)] + public static partial Regex GetNumberRegex(); + + [GeneratedRegex(@"\B(?=(\d{3})+(?!\d))", RegexOptions.Compiled)] + public static partial Regex GetThousandGroupRegex(); } From 53255c3a9c19e736d3a689796a153f22f919f530 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 27 Jul 2025 18:41:23 +0800 Subject: [PATCH 12/15] Fix typo --- Plugins/Flow.Launcher.Plugin.Calculator/Languages/ar.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/cs.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/da.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/de.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/es-419.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/fr.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/he.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/it.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/ko.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/nb.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/nl.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/pl.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-br.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-pt.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/ru.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/sr.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/tr.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/uk-UA.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/vi.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-cn.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-tw.xaml | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 4 ++-- 26 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ar.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ar.xaml index df523b17b..d38f136a6 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ar.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ar.xaml @@ -1,8 +1,8 @@  - آلة حاسبة - تمكنك من إجراء العمليات الحسابية. (جرب 5*3-2 في Flow Launcher) + آلة حاسبة + تمكنك من إجراء العمليات الحسابية. (جرب 5*3-2 في Flow Launcher) ليست رقمًا (NaN) التعبير خاطئ أو غير مكتمل (هل نسيت بعض الأقواس؟) نسخ هذا الرقم إلى الحافظة diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/cs.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/cs.xaml index 0767248b7..56b908031 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/cs.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/cs.xaml @@ -1,8 +1,8 @@  - Kalkulačka - Umožňuje provádět matematické výpočty.(Try 5*3-2 v průtokovém spouštěči) + Kalkulačka + Umožňuje provádět matematické výpočty.(Try 5*3-2 v průtokovém spouštěči) Není číslo (NaN) Nesprávný nebo neúplný výraz (Nezapomněli jste na závorky?) Kopírování výsledku do schránky diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/da.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/da.xaml index 8287fe2f1..c5690a3d5 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/da.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/da.xaml @@ -1,8 +1,8 @@  - Calculator - Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) + Calculator + Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) Not a number (NaN) Expression wrong or incomplete (Did you forget some parentheses?) Copy this number to the clipboard diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/de.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/de.xaml index eead8b6ca..9b8654962 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/de.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/de.xaml @@ -1,8 +1,8 @@  - Rechner - Ermöglicht mathematische Berechnungen. (Versuchen Sie 5*3-2 in Flow Launcher) + Rechner + Ermöglicht mathematische Berechnungen. (Versuchen Sie 5*3-2 in Flow Launcher) Nicht eine Zahl (NaN) Ausdruck falsch oder unvollständig (Haben Sie einige Klammern vergessen?) Diese Zahl in die Zwischenablage kopieren diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml index 502c07238..e0084a31d 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml @@ -3,8 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib"> - Calculator - Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) + Calculator + Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) Not a number (NaN) Expression wrong or incomplete (Did you forget some parentheses?) Copy this number to the clipboard diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es-419.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es-419.xaml index 7d04db7f5..6b69c06a4 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es-419.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es-419.xaml @@ -1,8 +1,8 @@  - Calculadora - Permite hacer cálculos matemáticos. (Pruebe con 5*3-2 en Flow Launcher) + Calculadora + Permite hacer cálculos matemáticos. (Pruebe con 5*3-2 en Flow Launcher) No es un número (NaN) Expresión incorrecta o incompleta (¿Olvidó algún paréntesis?) Copiar este número al portapapeles diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml index 7f6e230db..3dfdff680 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/es.xaml @@ -1,8 +1,8 @@  - Calculadora - Permite hacer cálculos matemáticos. (Pruebe 5*3-2 en Flow Launcher) + Calculadora + Permite hacer cálculos matemáticos. (Pruebe 5*3-2 en Flow Launcher) No es un número (NaN) Expresión incorrecta o incompleta (¿Ha olvidado algunos paréntesis?) Copiar este número al portapapeles diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/fr.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/fr.xaml index 60087c9a2..a86c020be 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/fr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/fr.xaml @@ -1,8 +1,8 @@  - Calculatrice - Permet de faire des calculs mathématiques.(Essayez 5*3-2 dans Flow Launcher) + Calculatrice + Permet de faire des calculs mathématiques.(Essayez 5*3-2 dans Flow Launcher) Pas un nombre (NaN) Expression incorrecte ou incomplète (avez-vous oublié certaines parenthèses ?) Copier ce chiffre dans le presse-papiers diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/he.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/he.xaml index 6bc43d2db..1d297381c 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/he.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/he.xaml @@ -1,8 +1,8 @@  - מחשבון - מאפשר לבצע חישובים מתמטיים. (נסה 5*3-2 ב-Flow Launcher) + מחשבון + מאפשר לבצע חישובים מתמטיים. (נסה 5*3-2 ב-Flow Launcher) לא מספר (NaN) הביטוי שגוי או לא שלם (האם שכחת סוגריים?) העתק מספר זה ללוח diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/it.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/it.xaml index 343e0feb3..27bd75304 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/it.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/it.xaml @@ -1,8 +1,8 @@  - Calcolatrice - Consente di eseguire calcoli matematici (provare 5*3-2 in Flow Launcher) + Calcolatrice + Consente di eseguire calcoli matematici (provare 5*3-2 in Flow Launcher) Non è un numero (NaN) Espressione sbagliata o incompleta (avete dimenticato delle parentesi?) Copiare questo numero negli appunti diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml index 735f145d9..30bae550a 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ja.xaml @@ -1,8 +1,8 @@  - 電卓 - 数式の計算ができます(Flow Launcherで「5*3-2」と入力してみてください) + 電卓 + 数式の計算ができます(Flow Launcherで「5*3-2」と入力してみてください) Not a number (NaN) Expression wrong or incomplete (Did you forget some parentheses?) この数字をクリップボードにコピーします diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ko.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ko.xaml index 14e3079f8..30e9b40a0 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ko.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ko.xaml @@ -1,8 +1,8 @@  - 계산기 - 수학 계산을 할 수 있습니다. Flow Launcher에서 5*3-2를 입력해보세요. + 계산기 + 수학 계산을 할 수 있습니다. Flow Launcher에서 5*3-2를 입력해보세요. 숫자가 아님 (NaN) 표현식이 잘못되었거나 불완전합니다. (괄호를 깜빡하셨나요?) 해당 숫자를 클립보드에 복사 diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nb.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nb.xaml index 34a3f9638..be233767f 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nb.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nb.xaml @@ -1,8 +1,8 @@  - Kalkulator - Lar deg gjøre matematiske beregninger. (Prøv 5*3-2 i Flow Launcher) + Kalkulator + Lar deg gjøre matematiske beregninger. (Prøv 5*3-2 i Flow Launcher) Ikke et tall (NaN) Uttrykk feil eller ufullstendig (glem noen parenteser?) Kopier dette nummeret til utklippstavlen diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nl.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nl.xaml index 8287fe2f1..c5690a3d5 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/nl.xaml @@ -1,8 +1,8 @@  - Calculator - Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) + Calculator + Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) Not a number (NaN) Expression wrong or incomplete (Did you forget some parentheses?) Copy this number to the clipboard diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pl.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pl.xaml index 5f6d6e766..75b52685a 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pl.xaml @@ -1,8 +1,8 @@  - Kalkulator - Szybkie wykonywanie obliczeń matematycznych. (Spróbuj wpisać 5*3-2 w oknie Flow Launchera) + Kalkulator + Szybkie wykonywanie obliczeń matematycznych. (Spróbuj wpisać 5*3-2 w oknie Flow Launchera) Nie liczba (NaN) Wyrażenie niepoprawne lub niekompletne (Czy zapomniałeś o nawiasach?) Skopiuj ten numer do schowka diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-br.xaml index 0eb4f3cd8..9b6f3708a 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-br.xaml @@ -1,8 +1,8 @@  - Calculadora - Permite fazer cálculos matemáticos.(Tente 5*3-2 no Flow Launcher) + Calculadora + Permite fazer cálculos matemáticos.(Tente 5*3-2 no Flow Launcher) Não é um número (NaN) Expressão errada ou incompleta (Você esqueceu de adicionar parênteses?) Copiar este numero para a área de transferência diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-pt.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-pt.xaml index 937ebb841..7b48d6fe9 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-pt.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/pt-pt.xaml @@ -1,8 +1,8 @@  - Calculadora - Permite a execução de cálculos matemáticos (experimente 5*3-2) + Calculadora + Permite a execução de cálculos matemáticos (experimente 5*3-2) Não é número (NN) Expressão errada ou incompleta (esqueceu-se de algum parêntese?) Copiar número para a área de transferência diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ru.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ru.xaml index 3adb1ea49..d1d03d604 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ru.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/ru.xaml @@ -1,8 +1,8 @@  - Калькулятор - Позволяет выполнять математические вычисления. (Попробуйте 5*3-2 в Flow Launcher) + Калькулятор + Позволяет выполнять математические вычисления. (Попробуйте 5*3-2 в Flow Launcher) Не является числом (NaN) Выражение неправильное или неполное (Вы забыли скобки?) Скопировать этот номер в буфер обмена diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml index cf2de9fe5..b1cf4a735 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml @@ -1,8 +1,8 @@  - Kalkulačka - Spracúva matematické operácie. (Skúste 5*3-2 vo Flow Launcheri) + Kalkulačka + Spracúva matematické operácie. (Skúste 5*3-2 vo Flow Launcheri) Nie je číslo (NaN) Nesprávny alebo neúplný výraz (Nezabudli ste na zátvorky?) Kopírovať výsledok do schránky diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sr.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sr.xaml index 8287fe2f1..c5690a3d5 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sr.xaml @@ -1,8 +1,8 @@  - Calculator - Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) + Calculator + Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) Not a number (NaN) Expression wrong or incomplete (Did you forget some parentheses?) Copy this number to the clipboard diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/tr.xaml index 9c722bde5..f307c65e2 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/tr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/tr.xaml @@ -1,8 +1,8 @@  - Hesap Makinesi - Matematiksel hesaplamalar yapmaya yarar. (5*3-2 yazmayı deneyin) + Hesap Makinesi + Matematiksel hesaplamalar yapmaya yarar. (5*3-2 yazmayı deneyin) Sayı değil (NaN) İfade hatalı ya da eksik. (Parantez koymayı mı unuttunuz?) Bu sayıyı panoya kopyala diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/uk-UA.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/uk-UA.xaml index b33993c4a..9f60f570a 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/uk-UA.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/uk-UA.xaml @@ -1,8 +1,8 @@  - Калькулятор - Дозволяє виконувати математичні обчислення (спробуйте 5*3-2 у Flow Launcher) + Калькулятор + Дозволяє виконувати математичні обчислення (спробуйте 5*3-2 у Flow Launcher) Не є числом (NaN) Вираз неправильний або неповний (Ви забули якісь дужки?) Скопіюйте це число в буфер обміну diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/vi.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/vi.xaml index f03af4ef0..688623b04 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/vi.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/vi.xaml @@ -1,8 +1,8 @@  - Máy tính - Cho phép thực hiện các phép tính toán học. (Thử 5*3-2 trong Flow Launcher) + Máy tính + Cho phép thực hiện các phép tính toán học. (Thử 5*3-2 trong Flow Launcher) Không phải là số (NaN) Biểu thức sai hoặc không đầy đủ (Bạn có quên một số dấu ngoặc đơn không?) Sao chép số này vào clipboard diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-cn.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-cn.xaml index a0e3d0f92..85159ed4f 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-cn.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-cn.xaml @@ -1,8 +1,8 @@  - 计算器 - 为 Flow Launcher 提供数学计算能力。(试着在 Flow Launcher 输入 5*3-2) + 计算器 + 为 Flow Launcher 提供数学计算能力。(试着在 Flow Launcher 输入 5*3-2) 请输入数字 表达错误或不完整(您是否忘记了一些括号?) 将结果复制到剪贴板 diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-tw.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-tw.xaml index 39b8d4e01..d3d448e1c 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-tw.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/zh-tw.xaml @@ -1,8 +1,8 @@  - 計算機 - 為 Flow Launcher 提供數學計算功能。(試著在 Flow Launcher 輸入 5*3-2) + 計算機 + 為 Flow Launcher 提供數學計算功能。(試著在 Flow Launcher 輸入 5*3-2) 不是一個數 (NaN) Expression wrong or incomplete (Did you forget some parentheses?) 複製此數至剪貼簿 diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 195d63e47..6bbc466ca 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -179,12 +179,12 @@ namespace Flow.Launcher.Plugin.Calculator public string GetTranslatedPluginTitle() { - return Localize.flowlauncher_plugin_caculator_plugin_name(); + return Localize.flowlauncher_plugin_calculator_plugin_name(); } public string GetTranslatedPluginDescription() { - return Localize.flowlauncher_plugin_caculator_plugin_description(); + return Localize.flowlauncher_plugin_calculator_plugin_description(); } public Control CreateSettingPanel() From afc969d00fc54be017bb7da7edadecd446142de0 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 27 Jul 2025 20:03:33 +0800 Subject: [PATCH 13/15] Update translations in language file --- Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml index 502c07238..25aaf97e7 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/en.xaml @@ -4,7 +4,7 @@ xmlns:system="clr-namespace:System;assembly=mscorlib"> Calculator - Allows to do mathematical calculations.(Try 5*3-2 in Flow Launcher) + Perform mathematical calculations (including hexadecimal values). Use ',' or '.' as thousand separator or decimal place. Not a number (NaN) Expression wrong or incomplete (Did you forget some parentheses?) Copy this number to the clipboard From ee4dc394d409ca20ba206ea5b8dffa0709a60051 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 28 Jul 2025 14:28:55 +0800 Subject: [PATCH 14/15] Clear plugin list selection to make sure all items can be mouse hovered --- .../SettingPages/Views/SettingsPanePlugins.xaml | 1 + .../SettingPages/Views/SettingsPanePlugins.xaml.cs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml index 52d77f914..aa7c219e5 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml @@ -122,6 +122,7 @@ FontSize="14" ItemContainerStyle="{StaticResource PluginList}" ItemsSource="{Binding Source={StaticResource PluginCollectionView}}" + Loaded="PluginListBox_Loaded" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled" SnapsToDevicePixels="True" diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs index f486a3443..e77a30843 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs @@ -1,4 +1,6 @@ using System.ComponentModel; +using System.Windows; +using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; using System.Windows.Navigation; @@ -33,6 +35,14 @@ public partial class SettingsPanePlugins base.OnNavigatedTo(e); } + private void PluginListBox_Loaded(object sender, RoutedEventArgs e) + { + // After list is loaded, we need to clear selection to make sure all items can be mouse hovered + // because the selected item cannot be hovered. + if (sender is not ListBox listBox) return; + listBox.SelectedIndex = -1; + } + private void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(SettingsPanePluginsViewModel.FilterText)) From 4db825debd08e6bb9f64dc3e26a29f14850f7fda Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 5 Aug 2025 15:15:11 +0800 Subject: [PATCH 15/15] Set CETCompat to false --- Directory.Build.props | 2 ++ Flow.Launcher/Flow.Launcher.csproj | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index fa499273c..a5545af12 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,7 @@ true + + false \ No newline at end of file diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 7db769c70..12c726e95 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -136,7 +136,6 @@ -