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.
This commit is contained in:
Kegan Dougal 2015-12-24 11:56:50 +00:00
parent b941904078
commit 103b0a03b1

View file

@ -170,6 +170,13 @@ class TabComplete {
this.stopTabCompleting(); 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 // pressing any key at all (except tab) restarts the automatic tab-complete timer
if (this.opts.autoEnterTabComplete) { if (this.opts.autoEnterTabComplete) {
clearTimeout(this.enterTabCompleteTimerId); clearTimeout(this.enterTabCompleteTimerId);