add command/binding to jump to currently playing track

fixes #181
This commit is contained in:
Henrik Friedrichsen
2020-04-18 21:57:41 +02:00
parent 510f1ff6ad
commit 4e7af1c920
5 changed files with 20 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ use cursive::Cursive;
use std::cmp::min;
use std::sync::Arc;
use crate::command::{Command, ShiftMode};
use crate::command::{Command, MoveMode, ShiftMode};
use crate::commands::CommandResult;
use crate::library::Library;
use crate::queue::Queue;
@@ -132,6 +132,11 @@ impl ViewExt for QueueView {
s.add_layer(dialog);
return Ok(CommandResult::Consumed(None));
}
Command::Move(MoveMode::Playing, _) => {
if let Some(playing) = self.queue.get_current_index() {
self.list.move_focus_to(playing);
}
}
_ => {}
}