diff --git a/Plugins/Wox.Plugin.Calculator/Main.cs b/Plugins/Wox.Plugin.Calculator/Main.cs index 010ff0b6f..c8c7fcb0b 100644 --- a/Plugins/Wox.Plugin.Calculator/Main.cs +++ b/Plugins/Wox.Plugin.Calculator/Main.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Windows; @@ -28,7 +28,8 @@ namespace Wox.Plugin.Caculator public List Query(Query query) { - if (query.Search.Length <= 2 // don't affect when user only input "e" or "i" keyword + // Don't affect when user only input "e" or "i" keyword + if (query.Search.Length <= 2 || !RegValidExpressChar.IsMatch(query.Search) || !IsBracketComplete(query.Search)) return new List(); @@ -43,7 +44,6 @@ namespace Wox.Plugin.Caculator if (result is Function) result = Context.API.GetTranslation("wox_plugin_calculator_expression_not_complete"); - if (!string.IsNullOrEmpty(result?.ToString())) { return new List