« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ui.js b/ui.js
index 0bddc64..7ce5fdd 100644
--- a/ui.js
+++ b/ui.js
@@ -155,9 +155,7 @@ class AppElement extends FocusElement {
               this.markGrouplike.items.push(item)
             },
             undo: () => {
-              // It SHOULD always be on the top, but juuust in case it isn't...
-              const index = this.markGrouplike.items.indexOf(item)
-              this.markGrouplike.items.splice(index, 1)
+              this.markGrouplike.items.pop()
             }
           })
         } else {
@@ -314,9 +312,9 @@ class AppElement extends FocusElement {
       this.cloneCurrentTab()
     } else if (keyBuf.equals(Buffer.from([23]))) { // ctrl-W
       this.tabber.closeTab(this.tabber.currentElement)
-    } else if (keyBuf.equals(Buffer.from(['j'.charCodeAt(0)]))) {
+    } else if (telc.isCharacter(keyBuf, 'u')) {
       this.undoManager.undoLastAction()
-    } else if (keyBuf.equals(Buffer.from(['J'.charCodeAt(0)]))) {
+    } else if (telc.isCharacter(keyBuf, 'U')) {
       this.undoManager.redoLastUndoneAction()
     } else if (this.tabber.isSelected && keyBuf.equals(Buffer.from(['t'.charCodeAt(0)]))) {
       this.tabber.nextTab()