Skip to content

Commit 62abf67

Browse files
committed
Code cleanup
1 parent 343b65c commit 62abf67

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ public enum DecimalSeparator
77
{
88
[EnumLocalizeKey(nameof(Localize.flowlauncher_plugin_calculator_decimal_separator_use_system_locale))]
99
UseSystemLocale,
10-
10+
1111
[EnumLocalizeKey(nameof(Localize.flowlauncher_plugin_calculator_decimal_separator_dot))]
12-
Dot,
13-
12+
Dot,
13+
1414
[EnumLocalizeKey(nameof(Localize.flowlauncher_plugin_calculator_decimal_separator_comma))]
1515
Comma
1616
}

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
using System.Runtime.InteropServices;
66
using System.Text.RegularExpressions;
77
using System.Windows.Controls;
8-
using Mages.Core;
9-
using Flow.Launcher.Plugin.Calculator.Views;
108
using Flow.Launcher.Plugin.Calculator.ViewModels;
9+
using Flow.Launcher.Plugin.Calculator.Views;
10+
using Mages.Core;
1111

1212
namespace Flow.Launcher.Plugin.Calculator
1313
{
@@ -57,10 +57,10 @@ public List<Result> Query(Query query)
5757
{
5858
var search = query.Search;
5959
bool isFunctionPresent = FunctionRegex.IsMatch(search);
60-
60+
6161
// Mages is case sensitive, so we need to convert all function names to lower case.
6262
search = FunctionRegex.Replace(search, m => m.Value.ToLowerInvariant());
63-
63+
6464
var decimalSep = GetDecimalSeparator();
6565
var groupSep = GetGroupSeparator(decimalSep);
6666
var expression = NumberRegex.Replace(search, m => NormalizeNumber(m.Value, isFunctionPresent, decimalSep, groupSep));
@@ -292,7 +292,7 @@ private static string NormalizeNumber(string numberStr, bool isFunctionPresent,
292292
{
293293
processedStr = processedStr.Replace(decimalSep, ".");
294294
}
295-
295+
296296
return processedStr;
297297
}
298298
else
@@ -310,7 +310,7 @@ private static string NormalizeNumber(string numberStr, bool isFunctionPresent,
310310
return processedStr;
311311
}
312312
}
313-
313+
314314
private static bool IsValidGrouping(string[] parts, int[] groupSizes)
315315
{
316316
if (parts.Length <= 1) return true;
@@ -326,7 +326,7 @@ private static bool IsValidGrouping(string[] parts, int[] groupSizes)
326326

327327
var lastGroupSize = groupSizes.Last();
328328
var canRepeatLastGroup = lastGroupSize != 0;
329-
329+
330330
int groupIndex = 0;
331331
for (int i = parts.Length - 1; i > 0; i--)
332332
{
@@ -335,7 +335,7 @@ private static bool IsValidGrouping(string[] parts, int[] groupSizes)
335335
{
336336
expectedSize = groupSizes[groupIndex];
337337
}
338-
else if(canRepeatLastGroup)
338+
else if (canRepeatLastGroup)
339339
{
340340
expectedSize = lastGroupSize;
341341
}
@@ -345,7 +345,7 @@ private static bool IsValidGrouping(string[] parts, int[] groupSizes)
345345
}
346346

347347
if (parts[i].Length != expectedSize) return false;
348-
348+
349349
groupIndex++;
350350
}
351351

Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-

2-
namespace Flow.Launcher.Plugin.Calculator;
1+
namespace Flow.Launcher.Plugin.Calculator;
32

43
public class Settings
54
{

0 commit comments

Comments
 (0)