From 0aed6a1fcc24a969beee61a99c753c85afe877d4 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 5 Jul 2018 17:47:36 -0300 Subject: uU instead of jJ / code simplification --- ui.js | 8 +++----- 1 file 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() -- cgit 1.3.0-6-gf8a5