Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add copy_song_url key
  • Loading branch information
LennyPenny authored and Rigellute committed Nov 22, 2019
commit 725d031a390e4037cc87270395fea95997d88697
3 changes: 3 additions & 0 deletions src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ pub fn handle_app(key: Key, app: &mut App) {
_ if key == app.user_config.keys.search => {
app.set_current_route_state(Some(ActiveBlock::Input), Some(ActiveBlock::Input));
}
_ if key == app.user_config.keys.copy_song_url => {
app.copy_song_url();
}
_ => handle_block_events(key, app),
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/user_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub struct KeyBindingsString {
repeat: Option<String>,
search: Option<String>,
submit: Option<String>,
copy_song_url: Option<String>,
}

pub struct KeyBindings {
Expand All @@ -118,6 +119,7 @@ pub struct KeyBindings {
pub repeat: Key,
pub search: Key,
pub submit: Key,
pub copy_song_url: Key,
}

#[derive(Default, Clone, Debug, PartialEq, Serialize, Deserialize)]
Expand Down Expand Up @@ -149,6 +151,7 @@ impl UserConfig {
repeat: Key::Ctrl('r'),
search: Key::Char('/'),
submit: Key::Char('\n'),
copy_song_url: Key::Char('c'),
},
}
}
Expand Down Expand Up @@ -209,6 +212,7 @@ impl UserConfig {
to_keys!(repeat);
to_keys!(search);
to_keys!(submit);
to_keys!(copy_song_url);

Ok(())
}
Expand Down