mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Do not check bracket complete
This commit is contained in:
parent
495ace1246
commit
daf35a4972
1 changed files with 0 additions and 36 deletions
|
|
@ -48,18 +48,6 @@ namespace Flow.Launcher.Plugin.Calculator
|
|||
return new List<Result>();
|
||||
}
|
||||
|
||||
if (!IsBracketComplete(query.Search))
|
||||
{
|
||||
return new List<Result>
|
||||
{
|
||||
new Result
|
||||
{
|
||||
Title = Localize.flowlauncher_plugin_calculator_expression_not_complete(),
|
||||
IcoPath = "Images/calculator.png"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var expression = NumberRegex.Replace(query.Search, m => NormalizeNumber(m.Value));
|
||||
|
|
@ -283,30 +271,6 @@ namespace Flow.Launcher.Plugin.Calculator
|
|||
};
|
||||
}
|
||||
|
||||
private static bool IsBracketComplete(string query)
|
||||
{
|
||||
var matchs = RegBrackets.Matches(query);
|
||||
var leftBracketCount = 0;
|
||||
foreach (Match match in matchs)
|
||||
{
|
||||
if (match.Value == "(" || match.Value == "[")
|
||||
{
|
||||
leftBracketCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
leftBracketCount--;
|
||||
}
|
||||
|
||||
if (leftBracketCount < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return leftBracketCount == 0;
|
||||
}
|
||||
|
||||
public string GetTranslatedPluginTitle()
|
||||
{
|
||||
return Localize.flowlauncher_plugin_calculator_plugin_name();
|
||||
|
|
|
|||
Loading…
Reference in a new issue