store reference to the matching brace highlight marker in the session

This commit is contained in:
Fabian Jakobs 2011-02-15 13:08:55 +01:00
commit ba244bce0a

View file

@ -219,9 +219,9 @@ var Editor =function(renderer, session) {
} }
this.$highlightBrackets = function() { this.$highlightBrackets = function() {
if (this.$bracketHighlight) { if (this.session.$bracketHighlight) {
this.session.removeMarker(this.$bracketHighlight); this.session.removeMarker(this.session.$bracketHighlight);
this.$bracketHighlight = null; this.session.$bracketHighlight = null;
} }
if (this.$highlightPending) { if (this.$highlightPending) {
@ -237,7 +237,7 @@ var Editor =function(renderer, session) {
var pos = self.session.findMatchingBracket(self.getCursorPosition()); var pos = self.session.findMatchingBracket(self.getCursorPosition());
if (pos) { if (pos) {
var range = new Range(pos.row, pos.column, pos.row, pos.column+1); var range = new Range(pos.row, pos.column, pos.row, pos.column+1);
self.$bracketHighlight = self.session.addMarker(range, "ace_bracket"); self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket");
} }
}, 10); }, 10);
}; };