mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-24 02:25:48 +08:00
Add selection orompt Search (#1289)
* Add selection prompt search as you type * Fix small bug * Simplify * Simplify * Remove spacebar as a selection prompt submit key * Trigger CI * Update src/Spectre.Console/Prompts/SelectionPrompt.cs Co-authored-by: Martin Costello <martin@martincostello.com> * Simplifty Mask method * Handle multi-selection prompt better * Update API naming * Address feedback * Add some tests * Remove whitespace * Improve search and highlighting * Add test case for previous issue * Add extra test case * Make prompt searchable --------- Co-authored-by: Martin Costello <martin@martincostello.com> Co-authored-by: Patrik Svensson <patrik@patriksvensson.se>
This commit is contained in:
@@ -31,12 +31,11 @@ internal static class EnumerableExtensions
|
||||
}
|
||||
|
||||
public static int IndexOf<T>(this IEnumerable<T> source, T item)
|
||||
where T : class
|
||||
{
|
||||
var index = 0;
|
||||
foreach (var candidate in source)
|
||||
{
|
||||
if (candidate == item)
|
||||
if (Equals(candidate, item))
|
||||
{
|
||||
return index;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user