mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-25 06:00:34 +00:00
Add get_selections to MultiListState
This commit is contained in:
parent
b4cc38f241
commit
7b3c8871f3
1 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
use std::collections::HashSet;
|
||||
use std::{borrow::Borrow, collections::HashSet};
|
||||
|
||||
use super::{Block, ListItem, StatefulWidget, Widget};
|
||||
use crate::{
|
||||
|
@ -47,6 +47,10 @@ impl MultiListState {
|
|||
pub fn get_highlight(&mut self) -> Option<usize> {
|
||||
self.highlighted
|
||||
}
|
||||
|
||||
pub fn get_selections(&self) -> &HashSet<usize> {
|
||||
self.selected.borrow()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
Loading…
Reference in a new issue