From 6df14d5553c243e8fae6920a793978da5e84e5f8 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Wed, 28 Sep 2016 12:03:58 -0700 Subject: [PATCH] fix(composer): Dedupe registered key bindings to avoid double undo in composer --- src/keymap-manager.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/keymap-manager.es6 b/src/keymap-manager.es6 index de7977de6..c1be7ccc8 100644 --- a/src/keymap-manager.es6 +++ b/src/keymap-manager.es6 @@ -181,7 +181,9 @@ export default class KeymapManager { if (!this._commandsCache[keystrokes]) { this._commandsCache[keystrokes] = []; } - this._commandsCache[keystrokes].push(command); + if (!this._commandsCache[keystrokes].includes(command)) { + this._commandsCache[keystrokes].push(command); + } } }