Skip to content

Commit

Permalink
implement actual marker selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thiel committed Jun 6, 2019
1 parent 2dafff4 commit 6ba885e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/interactive/widgets/mark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ impl MarkPane {
};
}

fn change_selection(&mut self, _direction: CursorDirection) {}
fn change_selection(&mut self, direction: CursorDirection) {
self.selected = self.selected.map(|selected| {
direction
.move_cursor(selected)
.min(self.marked.len().saturating_sub(1))
});
}

pub fn render(&mut self, props: impl Borrow<MarkPaneProps>, area: Rect, buf: &mut Buffer) {
let MarkPaneProps { border_style } = props.borrow();
Expand Down

0 comments on commit 6ba885e

Please sign in to comment.