Skip to content

Commit

Permalink
ace with switching modes
Browse files Browse the repository at this point in the history
  • Loading branch information
zalun committed Feb 3, 2011
1 parent 7964145 commit a6d91c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions media/lib/ace/ace-uncompressed.js
Expand Up @@ -6566,7 +6566,7 @@ var EditSession = function(text, mode) {
* }
*/
this.setAnnotations = function(annotations) {
this.$annotations = [];
this.$annotations = {};
for (var i=0; i<annotations.length; i++) {
var annotation = annotations[i];
var row = annotation.row;
Expand All @@ -6583,7 +6583,7 @@ var EditSession = function(text, mode) {
};

this.clearAnnotations = function() {
this.$annotations = [];
this.$annotations = {};
this._dispatchEvent("changeAnnotation", {});
};

Expand Down Expand Up @@ -10615,6 +10615,7 @@ var WorkerClient = function(baseUrl, topLevelNamespaces, packagedJs, module, cla

var _self = this;
this.$worker.onerror = function(e) {
console.log(e);
throw e;
};
this.$worker.onmessage = function(e) {
Expand Down Expand Up @@ -11642,12 +11643,15 @@ var Gutter = function(parentEl) {

this.setAnnotations = function(annotations) {
// iterate over sparse array
this.$annotations = [];
this.$annotations = [];
for (var row in annotations) {
var rowAnnotations = annotations[row];
if (!rowAnnotations)
continue;

var rowInfo = this.$annotations[row] = {
text: []
};
var rowAnnotations = annotations[row];
for (var i=0; i<rowAnnotations.length; i++) {
var annotation = rowAnnotations[i];
rowInfo.text.push(annotation.text.replace(/"/g, "&quot;").replace(/'/g, "&rsquo;").replace(/</, "&lt;"));
Expand Down
2 changes: 1 addition & 1 deletion media/lib/ace/ace.js

Large diffs are not rendered by default.

0 comments on commit a6d91c7

Please sign in to comment.