« get me outta code hell

http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/keybinder.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/keybinder.js')
-rw-r--r--src/keybinder.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/keybinder.js b/src/keybinder.js
index d6e0113..784484c 100644
--- a/src/keybinder.js
+++ b/src/keybinder.js
@@ -49,13 +49,16 @@ module.exports.compileKeybindings = function(bindings, commands) {
     return function(inputData) {
       if (buffer.equals(inputData)) {
         commands[command](...args)
+        return true
       }
     }
   }).filter(Boolean)
 
   return function(inputData) {
-    for (let handler of handlers) {
-      handler(inputData)
+    for (const handler of handlers) {
+      if (handler(inputData)) {
+        break
+      }
     }
   }
 }