Set minimum expression lenght to 2

Calculations like 8! haven't been possible before due to a validation on
the minimum query lenght.
This commit is contained in:
SysC0mp 2020-02-25 17:48:18 +01:00
parent b37669b77e
commit 3d3d9435dc

View file

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Windows;
@ -29,9 +29,12 @@ namespace Wox.Plugin.Caculator
public List<Result> Query(Query query)
{
// Don't affect when user only input "e" or "i" keyword
if (query.Search.Length <= 2
if (query.Search.Length < 2
|| !RegValidExpressChar.IsMatch(query.Search)
|| !IsBracketComplete(query.Search)) return new List<Result>();
|| !IsBracketComplete(query.Search))
{
return new List<Result>();
}
try
{