From 9944dfc821674b4e464ffccf1696a0345e0e095e Mon Sep 17 00:00:00 2001 From: Nils Rokita <0rokita@informatik.uni-hamburg.de> Date: Wed, 4 Jan 2012 15:38:03 +0100 Subject: [PATCH] fix little error --- static/js/ace2_inner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 78f556586..747950046 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -2573,10 +2573,11 @@ function OUTER(gscope) function toggleAttributeOnSelectedLine(attributeName) { + if (!(rep.selStart && rep.selEnd)) return; //set the full line to be selected rep.selStart[1]=0; - rep.selEnd[1]=rep.lines.atIndex(rep.selEnd[0]).text.length - toggleAttributeOnSelection(attributeName) + rep.selEnd[1]=rep.lines.atIndex(rep.selEnd[0]).text.length; + toggleAttributeOnSelection(attributeName); } editorInfo.ace_toggleAttributeOnSelectedLine = toggleAttributeOnSelectedLine;