mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Add SelectView::selected
This commit is contained in:
parent
8f3441bc3c
commit
847fd7d800
@ -324,6 +324,13 @@ impl<T: 'static> SelectView<T> {
|
|||||||
self.scrollbase.scroll_to(i);
|
self.scrollbase.scroll_to(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the selection to the given position.
|
||||||
|
///
|
||||||
|
/// Chainable variant.
|
||||||
|
pub fn selected(self, i: usize) -> Self {
|
||||||
|
self.with(|s| s.set_selection(i))
|
||||||
|
}
|
||||||
|
|
||||||
/// Moves the selection up by the given number of rows.
|
/// Moves the selection up by the given number of rows.
|
||||||
pub fn select_up(&mut self, n: usize) {
|
pub fn select_up(&mut self, n: usize) {
|
||||||
self.focus_up(n);
|
self.focus_up(n);
|
||||||
|
Loading…
Reference in New Issue
Block a user