mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00

* 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>
15 lines
330 B
C#
15 lines
330 B
C#
namespace Spectre.Console.Tests;
|
|
|
|
public static class ConsoleKeyExtensions
|
|
{
|
|
public static ConsoleKeyInfo ToConsoleKeyInfo(this ConsoleKey key)
|
|
{
|
|
var ch = (char)key;
|
|
if (char.IsControl(ch))
|
|
{
|
|
ch = '\0';
|
|
}
|
|
|
|
return new ConsoleKeyInfo(ch, key, false, false, false);
|
|
}
|
|
} |