aboutsummaryrefslogtreecommitdiff
path: root/src/event/pl_rename_keys.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/event/pl_rename_keys.rs')
-rwxr-xr-xsrc/event/pl_rename_keys.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/event/pl_rename_keys.rs b/src/event/pl_rename_keys.rs
deleted file mode 100755
index c9fc050..0000000
--- a/src/event/pl_rename_keys.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-use crate::{
- app::{App, AppResult},
- ui::InputMode,
-};
-use crossterm::event::{KeyCode, KeyEvent};
-
-pub fn handle_pl_rename_keys(key_event: KeyEvent, app: &mut App) -> AppResult<()> {
- match key_event.code {
- KeyCode::Esc => {
- app.pl_newname_input.clear();
- app.reset_cursor();
- app.inputmode = InputMode::Normal;
- }
- KeyCode::Char(to_insert) => {
- app.enter_char(to_insert);
- }
- KeyCode::Enter => {
- app.conn.conn.pl_rename(
- app.pl_list.get_item_at_current_index(),
- &app.pl_newname_input,
- )?;
- app.pl_list.list = App::get_playlist(&mut app.conn.conn)?;
- app.pl_newname_input.clear();
- app.reset_cursor();
- app.inputmode = InputMode::Normal;
- }
-
- KeyCode::Backspace => {
- app.delete_char();
- }
-
- KeyCode::Left => {
- app.move_cursor_left();
- }
-
- KeyCode::Right => {
- app.move_cursor_right();
- }
-
- _ => {}
- }
- Ok(())
-}