« get me outta code hell

uU instead of jJ / code simplification - 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-07-05 17:47:36 -0300
committerFlorrie <towerofnix@gmail.com>2018-07-05 17:47:36 -0300
commit0aed6a1fcc24a969beee61a99c753c85afe877d4 (patch)
tree764c2129cdc958bdf42a8a0ff85250101e90733b
parenta5ffe6a882598edc8b67fed12de78642fd6d1a5a (diff)
uU instead of jJ / code simplification
-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()