mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 13:48:16 +08:00
Allow selections to wrap around
This commit is contained in:
@ -18,6 +18,12 @@ public sealed class MultiSelectionPrompt<T> : IPrompt<List<T>>, IListPromptStrat
|
||||
/// </summary>
|
||||
public int PageSize { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the selection should wrap around when reaching the edge.
|
||||
/// Defaults to <c>false</c>.
|
||||
/// </summary>
|
||||
public bool WrapAround { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the highlight style of the selected choice.
|
||||
/// </summary>
|
||||
@ -88,7 +94,7 @@ public sealed class MultiSelectionPrompt<T> : IPrompt<List<T>>, IListPromptStrat
|
||||
{
|
||||
// Create the list prompt
|
||||
var prompt = new ListPrompt<T>(console, this);
|
||||
var result = await prompt.Show(Tree, cancellationToken, PageSize).ConfigureAwait(false);
|
||||
var result = await prompt.Show(Tree, cancellationToken, PageSize, WrapAround).ConfigureAwait(false);
|
||||
|
||||
if (Mode == SelectionMode.Leaf)
|
||||
{
|
||||
|
Reference in New Issue
Block a user