//
var lang = ace.require("ace/lib/lang");
var statusUpdate = lang.delayedCall(function(){
this.updateStatus(editor)
}.bind(this)).schedule.bind(null, 100);
var statusUpdate = lang.delayedCall(function(){
var status = [];
function add(str, separator) {
str && status.push(str, separator || " | ");
}
//
add(editor.keyBinding.getStatusText(editor));
if (editor.commands.recording) add("REC");
//
var sel = editor.selection;
var c = sel.lead;
//
if (!sel.isEmpty()) {
var r = editor.getSelectionRange();
add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")", " ");
}
add("Ln: " + (c.row + 1) + " Col: " + (c.column + 1), " ");
if (sel.rangeCount) add("[" + sel.rangeCount + "]", " ");
status.pop();
statusBar.textContent = status.join("");
}.bind(this)).schedule.bind(null, 100);
editor.on("changeStatus", statusUpdate);
editor.on("changeSelection", statusUpdate);
editor.on("keyboardActivity", statusUpdate);
statusUpdate();
})();