From 6d454e06570b727221eff348408db51033957367 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 8 Nov 2017 12:18:57 -0400 Subject: Only run 'top' keybinding for a specific combo This lets custom keybinding files partially overwrite pre- existing ketbindings. --- src/keybinder.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/keybinder.js') 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 + } } } } -- cgit 1.3.0-6-gf8a5