mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
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:
parent
b37669b77e
commit
3d3d9435dc
1 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue