Work in progress, brackets freezing on document.replaceRange