Commit 5c07958e authored by Christian's avatar Christian Committed by chriseth

Do not compile while typing.

parent 871e16cf
......@@ -128,12 +128,14 @@ var compile = function() {
outputArea.innerHTML = "Uncaught JavaScript Exception:\n" + exception;
}
}
var compileTimeout = null;
var onChange = function() {
var input = editor.getValue();
if (input == previousInput)
return;
previousInput = input;
compile();
if (compileTimeout) window.clearTimeout(compileTimeout);
compileTimeout = window.setTimeout(compile, 300);
};
editor.getSession().on('change', onChange);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment