Skip to content

Commit

Permalink
remove move_to_{head, tail} from menu and checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Feb 10, 2024
1 parent 24bc8d1 commit ac37bf5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
4 changes: 0 additions & 4 deletions src/core/checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,4 @@ impl Checkbox {
pub fn move_to_head(&mut self) {
self.menu.move_to_head()
}

pub fn move_to_tail(&mut self) {
self.menu.move_to_tail()
}
}
14 changes: 0 additions & 14 deletions src/core/checkbox/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ impl Renderable for Renderer {
/// | <kbd> CTRL + C </kbd> | Exit the event-loop with an error
/// | <kbd> ↑ </kbd> | Move backward
/// | <kbd> ↓ </kbd> | Move forward
/// | <kbd> CTRL + A </kbd> | Move to the beginning of the items
/// | <kbd> CTRL + E </kbd> | Move to the end of the items
fn handle_event(&mut self, event: &Event) {
match event {
// Move cursor.
Expand All @@ -95,18 +93,6 @@ impl Renderable for Renderer {
}) => {
self.checkbox.forward();
}
Event::Key(KeyEvent {
code: KeyCode::Char('a'),
modifiers: KeyModifiers::CONTROL,
kind: KeyEventKind::Press,
state: KeyEventState::NONE,
}) => self.checkbox.move_to_head(),
Event::Key(KeyEvent {
code: KeyCode::Char('e'),
modifiers: KeyModifiers::CONTROL,
kind: KeyEventKind::Press,
state: KeyEventState::NONE,
}) => self.checkbox.move_to_tail(),
Event::Key(KeyEvent {
code: KeyCode::Char(' '),
modifiers: KeyModifiers::NONE,
Expand Down
4 changes: 0 additions & 4 deletions src/core/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,4 @@ impl Menu {
pub fn move_to_head(&mut self) {
self.0.move_to_head()
}

pub fn move_to_tail(&mut self) {
self.0.move_to_tail()
}
}
14 changes: 0 additions & 14 deletions src/core/menu/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ impl Renderable for Renderer {
/// | <kbd> CTRL + C </kbd> | Exit the event-loop with an error
/// | <kbd> ↑ </kbd> | Move backward
/// | <kbd> ↓ </kbd> | Move forward
/// | <kbd> CTRL + A </kbd> | Move to the beginning of the items
/// | <kbd> CTRL + E </kbd> | Move to the end of the items
fn handle_event(&mut self, event: &Event) {
match event {
// Move cursor.
Expand All @@ -78,18 +76,6 @@ impl Renderable for Renderer {
}) => {
self.menu.forward();
}
Event::Key(KeyEvent {
code: KeyCode::Char('a'),
modifiers: KeyModifiers::CONTROL,
kind: KeyEventKind::Press,
state: KeyEventState::NONE,
}) => self.menu.move_to_head(),
Event::Key(KeyEvent {
code: KeyCode::Char('e'),
modifiers: KeyModifiers::CONTROL,
kind: KeyEventKind::Press,
state: KeyEventState::NONE,
}) => self.menu.move_to_tail(),

_ => (),
}
Expand Down

0 comments on commit ac37bf5

Please sign in to comment.