public ShortCutMatch Matches(string input) { if (string.IsNullOrWhiteSpace(input)) { return(ShortCutMatch.Fail); } var startsWithHash = input.First() == '#'; if (input.Length == 1 && startsWithHash) { return(new ShortCutMatch(0, this)); } if (startsWithHash) { input = input.Substring(1); } //Doesn't make sense to use, because Wox resort results and doesn't care about order of results in Plugin output var lastIndex = -1; var searchIndex = 0; foreach (var part in input) { var index = Shortcut.IndexOf(part.ToString(), lastIndex + 1, StringComparison.InvariantCultureIgnoreCase); if (index <= lastIndex) { return(ShortCutMatch.Fail); } searchIndex += index - lastIndex - 1; lastIndex = index; } return(Shortcut.ContainsCaseInsensitive(input) ? new ShortCutMatch(searchIndex, this) : ShortCutMatch.Fail); }