summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Bartelmeß <mba@fourplusone.de>2012-04-05 15:26:51 +0200
committerMatthias Bartelmeß <mba@fourplusone.de>2012-04-05 15:26:51 +0200
commitff9e4070921867031fec50f794ce44404df5dc1e (patch)
tree4cbeb97cd375f8b73cd2882c32ee3718ad7e57a4
parent2ccc70daf6962e6b388bf20114b9d6d9630ce112 (diff)
downloadetherpad-lite-ff9e4070921867031fec50f794ce44404df5dc1e.zip
Minor coding style improvement. Does the same as before
-rw-r--r--src/static/js/ace2_inner.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index 28e2f2a7..4dcd5edc 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -2272,11 +2272,8 @@ function Ace2Inner(){
function performDocumentApplyAttributesToCharRange(start, end, attribs)
{
- if (end >= rep.alltext.length)
- {
- end = rep.alltext.length - 1;
- }
- performDocumentApplyAttributesToRange(lineAndColumnFromChar(start), lineAndColumnFromChar(end), attribs);
+ end = Math.min(end, rep.alltext.length - 1);
+ documentAttributeManager.setAttributesOnRange(lineAndColumnFromChar(start), lineAndColumnFromChar(end), attribs);
}
editorInfo.ace_performDocumentApplyAttributesToCharRange = performDocumentApplyAttributesToCharRange;