Skip to content

Commit daf35a4

Browse files
committed
Do not check bracket complete
1 parent 495ace1 commit daf35a4

File tree

1 file changed

+0
-36
lines changed
  • Plugins/Flow.Launcher.Plugin.Calculator

1 file changed

+0
-36
lines changed

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

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,6 @@ public List<Result> Query(Query query)
4848
return new List<Result>();
4949
}
5050

51-
if (!IsBracketComplete(query.Search))
52-
{
53-
return new List<Result>
54-
{
55-
new Result
56-
{
57-
Title = Localize.flowlauncher_plugin_calculator_expression_not_complete(),
58-
IcoPath = "Images/calculator.png"
59-
}
60-
};
61-
}
62-
6351
try
6452
{
6553
var expression = NumberRegex.Replace(query.Search, m => NormalizeNumber(m.Value));
@@ -283,30 +271,6 @@ private string GetDecimalSeparator()
283271
};
284272
}
285273

286-
private static bool IsBracketComplete(string query)
287-
{
288-
var matchs = RegBrackets.Matches(query);
289-
var leftBracketCount = 0;
290-
foreach (Match match in matchs)
291-
{
292-
if (match.Value == "(" || match.Value == "[")
293-
{
294-
leftBracketCount++;
295-
}
296-
else
297-
{
298-
leftBracketCount--;
299-
}
300-
301-
if (leftBracketCount < 0)
302-
{
303-
return false;
304-
}
305-
}
306-
307-
return leftBracketCount == 0;
308-
}
309-
310274
public string GetTranslatedPluginTitle()
311275
{
312276
return Localize.flowlauncher_plugin_calculator_plugin_name();

0 commit comments

Comments
 (0)