diff --git a/lib/ace/ext/language_tools.js b/lib/ace/ext/language_tools.js index e7cb1fba..0e12e4df 100644 --- a/lib/ace/ext/language_tools.js +++ b/lib/ace/ext/language_tools.js @@ -120,6 +120,20 @@ var onChangeAutocomplete = function(e, editor) { var pos = editor.getCursorPosition(); var line = session.getLine(pos.row); + // Detect paste (poor man's paste detection) + var pasting = ( + ( + e.data.action === 'insertText' && + e.data.text.length > 1 + ) || + e.data.action === 'insertLines' + ); + + // we don't want to autocomplete on paste events + if(pasting) { + return; + } + // Append added text to the line if(e.data.action === 'insertText') { line += e.data.text;