Use methods for this behavior.

This commit is contained in:
Chad Weider 2012-05-22 15:55:43 -07:00
parent db4e59af82
commit fa289cfd4a

View file

@ -76,8 +76,6 @@ function DOMLine(nonEmpty, doesWrap, browser, document) {
this.postHtml = '';
this.curHTML = null;
this.perTextNodeProcess = (doesWrap ? _.identity : this.processSpaces);
this.perHtmlLineProcess = (doesWrap ? this.processSpaces : _.identity);
this.lineClass = 'ace-line';
// Apparently overridden at the instance level sometimes...
@ -87,6 +85,23 @@ function DOMLine(nonEmpty, doesWrap, browser, document) {
DOMLine.prototype = {};
(function () {
this.perTextNodeProcess = function (s) {
if (this.doesWrap) {
return _.identity(s);
} else {
return this.processSpaces(s);
}
}
this.perHtmlLineProcess = function (s) {
if (this.doesWrap) {
return this.processSpaces(s);
} else {
return _.identity(s);
}
}
this.processSpaces = function(s)
{
return processSpaces(s, this.doesWrap);