let the document act as anchor factory

This commit is contained in:
Fabian Jakobs 2011-02-17 16:11:03 +01:00
commit 8e3c1e6096
2 changed files with 7 additions and 3 deletions

View file

@ -42,15 +42,14 @@ var oop = require("pilot/oop");
var lang = require("pilot/lang");
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var Range = require("ace/range").Range;
var Anchor = require("ace/anchor").Anchor;
var Selection = function(session) {
this.session = session;
this.doc = session.getDocument();
this.clearSelection();
this.selectionLead = new Anchor(this.doc, 0, 0);
this.selectionAnchor = new Anchor(this.doc, 0, 0);
this.selectionLead = this.doc.createAnchor(0, 0);
this.selectionAnchor = this.doc.createAnchor(0, 0);
var _self = this;
this.selectionLead.on("change", function(e) {