From e077517faf6218a9acb284ca4795e85f55a8fbd4 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 22 Dec 2015 15:13:11 +0000 Subject: [PATCH] Ignore more keys when determining if the user is typing Specifically ignore CTRL, ALT, META, SHIFT, WINDOWS. --- src/TabComplete.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TabComplete.js b/src/TabComplete.js index fc3478b8f7..958ec76118 100644 --- a/src/TabComplete.js +++ b/src/TabComplete.js @@ -18,6 +18,7 @@ var Entry = require("./TabCompleteEntries").Entry; const DELAY_TIME_MS = 500; const KEY_TAB = 9; const KEY_SHIFT = 16; +const KEY_WINDOWS = 91; // word boundary -> 1 or more non-whitespace chars (group) -> end of line const MATCH_REGEX = /\b(\S+)$/; @@ -130,7 +131,8 @@ class TabComplete { */ onKeyDown(ev) { if (ev.keyCode !== KEY_TAB) { - if (ev.keyCode !== KEY_SHIFT && this.completing) { + if (this.completing && ev.keyCode !== KEY_SHIFT && + !ev.metaKey && !ev.ctrlKey && !ev.altKey && ev.keyCode !== KEY_WINDOWS) { // they're resuming typing; reset tab complete state vars. this.stopTabCompleting(); return true;