From e76a389e88d5d0837cb39e19164a04c11672c9f3 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Wed, 5 Feb 2014 20:10:20 +0100 Subject: [PATCH] Clarify typing condition in live autocomplete --- lib/ace/ext/language_tools.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ace/ext/language_tools.js b/lib/ace/ext/language_tools.js index fa913e5b..9bb5da6a 100644 --- a/lib/ace/ext/language_tools.js +++ b/lib/ace/ext/language_tools.js @@ -124,14 +124,10 @@ var onChangeAutocomplete = function(e) { var text = e.args || ""; - // Detect paste (poor man's paste detection) - var typing = !( - ( - e.command.name === "insertstring" && - text.length > 1 - ) || - e.command.name !== "insertstring" - ); + // Is the user entering text + // we only want to automatically show the autocomplete dialog + // whenever the user is typing in text not pasting, deleting, ... + var typing = (e.command.name === "insertstring" && text.length === 1); // We don't want to autocomplete with no prefix if(