Merge branch 'master' of github.com:ajaxorg/ace

This commit is contained in:
Fabian Jakobs 2011-02-10 17:56:07 +01:00
commit b6b25168e2
2 changed files with 7 additions and 1 deletions

View file

@ -669,6 +669,7 @@ var EditSession = function(text, mode) {
this.setWrapLimit = function(wrapLimit) { this.setWrapLimit = function(wrapLimit) {
if (wrapLimit != this.$wrapLimit) { if (wrapLimit != this.$wrapLimit) {
this.$wrapLimit = wrapLimit; this.$wrapLimit = wrapLimit;
this.$modified = true;
if (this.$useWrapMode) { if (this.$useWrapMode) {
this.$updateWrapData(0, this.getLength() - 1); this.$updateWrapData(0, this.getLength() - 1);
} }

View file

@ -149,7 +149,7 @@ var Editor =function(renderer, session) {
this.$onDocumentChangeTabSize = this.renderer.updateText.bind(this.renderer); this.$onDocumentChangeTabSize = this.renderer.updateText.bind(this.renderer);
session.addEventListener("changeTabSize", this.$onDocumentChangeTabSize); session.addEventListener("changeTabSize", this.$onDocumentChangeTabSize);
this.$onDocumentChangeWrapMode = this.renderer.updateFull.bind(this.renderer); this.$onDocumentChangeWrapMode = this.onDocumentChangeWrapMode.bind(this);
session.addEventListener("changeWrapMode", this.$onDocumentChangeWrapMode); session.addEventListener("changeWrapMode", this.$onDocumentChangeWrapMode);
this.$onDocumentChangeBreakpoint = this.onDocumentChangeBreakpoint.bind(this); this.$onDocumentChangeBreakpoint = this.onDocumentChangeBreakpoint.bind(this);
@ -348,6 +348,11 @@ var Editor =function(renderer, session) {
this.renderer.setTokenizer(this.bgTokenizer); this.renderer.setTokenizer(this.bgTokenizer);
}; };
this.onDocumentChangeWrapMode = function() {
this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite);
this.renderer.updateFull();
};
this.getCopyText = function() { this.getCopyText = function() {
if (!this.selection.isEmpty()) { if (!this.selection.isEmpty()) {
return this.session.getTextRange(this.getSelectionRange()); return this.session.getTextRange(this.getSelectionRange());