From 103b0a03b1a7003d20777f32271eeda94a94b4e5 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 24 Dec 2015 11:56:50 +0000 Subject: [PATCH] Hotfix for tab press bug The bug was that *sometimes* typing in some letters then pressing tab would flash red and not auto-complete. This was happening because nextMatchedEntry was being called with 0 because the state of inPassiveMode was wrong. --- src/TabComplete.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/TabComplete.js b/src/TabComplete.js index b84192e418..94be0193c6 100644 --- a/src/TabComplete.js +++ b/src/TabComplete.js @@ -170,6 +170,13 @@ class TabComplete { this.stopTabCompleting(); } + + // explicitly pressing any key except tab removes passive mode. Tab doesn't remove + // passive mode because handleTabPress needs to know when passive mode is toggling + // off so it can resync the textarea/peek list. If tab did remove passive mode then + // handleTabPress would never be able to tell when passive mode toggled off. + this.inPassiveMode = false; + // pressing any key at all (except tab) restarts the automatic tab-complete timer if (this.opts.autoEnterTabComplete) { clearTimeout(this.enterTabCompleteTimerId);