Skip to content

Commit

Permalink
fix: tui filter input box j/k not insert character
Browse files Browse the repository at this point in the history
  • Loading branch information
7sDream committed May 10, 2024
1 parent be52327 commit 6b75202
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/preview/terminal/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,14 @@ impl<'a> UI<'a> {
self.state.next_render_type();
OnEventResult::ReDraw
}
CtKeyCode::Char('j') => {
self.state.move_down();
OnEventResult::ReDraw
}
CtKeyCode::Char('k') => {
self.state.move_up();
OnEventResult::ReDraw
}
CtKeyCode::Char('s') | CtKeyCode::Char('/') => {
self.editing = Some(WhichInput::Search);
OnEventResult::ReDraw
Expand All @@ -415,11 +423,11 @@ impl<'a> UI<'a> {
})
}
TerminalEvent::Key(key) => match key.code {
CtKeyCode::Up | CtKeyCode::Char('k') => {
CtKeyCode::Up => {
self.state.move_up();
Ok(OnEventResult::ReDraw)
}
CtKeyCode::Down | CtKeyCode::Char('j') => {
CtKeyCode::Down => {
self.state.move_down();
Ok(OnEventResult::ReDraw)
}
Expand Down

0 comments on commit 6b75202

Please sign in to comment.