refactor selection support into a separate class

Merge branch 'master' into HEAD

Conflicts:
	src/Editor.js
	src/KeyBinding.js
	src/Selection.js
This commit is contained in:
Fabian Jakobs 2010-04-15 13:58:49 +02:00
commit 7529f90080
12 changed files with 887 additions and 680 deletions

View file

@ -3,6 +3,7 @@ ace.provide("ace.TextDocument");
ace.TextDocument = function(text) {
this.lines = this._split(text);
this.modified = true;
this.selection = new ace.Selection(this);
this.listeners = [];
};
@ -15,6 +16,10 @@ ace.TextDocument.prototype.toString = function() {
return this.lines.join("\n");
};
ace.TextDocument.prototype.getSelection = function() {
return this.selection;
};
ace.TextDocument.prototype.addChangeListener = function(listener) {
this.listeners.push(listener);
};