« get me outta code hell

Make cursor follow selection in queue listing - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-12-21 11:37:05 -0400
committerFlorrie <towerofnix@gmail.com>2018-12-21 11:37:05 -0400
commit4238f9b72c46ac45fb5481921844641927524a14 (patch)
tree72b58249016627089488203d8b1e4df3a477eecd
parent4692882d63ee3f1af74c60b2794c78c87ebfc554 (diff)
Make cursor follow selection in queue listing
This was already half-done, but the new behavior in this commit feels
quite a bit nicer. (Specifically if you use shift-up/down (or n/p) while
the queue is selected, the cursor will move to the new selection if it
was already on the old selection, whereas before it would never follow
when the queue was selected.)
-rw-r--r--ui.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 0604873..3a7f70d 100644
--- a/ui.js
+++ b/ui.js
@@ -720,7 +720,8 @@ class AppElement extends FocusElement {
       this.recordStore.getRecord(item).playing = true
       this.playingTrack = item
       this.playbackInfoElement.updateTrack(item)
-      if (!this.queueListingElement.isSelected) {
+
+      if (this.queueListingElement.currentItem === oldTrack) {
         this.queueListingElement.selectAndShow(item)
       }