From 0aeaa3c575e010e1c4045633862c948eeebeecc2 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 19 Jul 2011 10:10:07 +0200 Subject: [PATCH] Un-break extra highlighted spaces at the end of selected lines These had been broken since the theme system overhaul. --- lib/codemirror.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index 566a5c300b..4f16b198fa 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -1791,7 +1791,7 @@ var CodeMirror = (function() { html.push(this.className ? '
': "
");
       function span(text, style) {
         if (!text) return;
-        if (style) html.push('', htmlEscape(text), "");
+        if (style) html.push('', htmlEscape(text), "");
         else html.push(htmlEscape(text));
       }
       var st = this.styles, allText = this.text, marked = this.marked;
@@ -1806,7 +1806,7 @@ var CodeMirror = (function() {
           var str = st[i], l = str.length;
           if (ch + l > len) str = str.slice(0, len - ch);
           ch += l;
-          span(str, st[i+1]);
+          span(str, "cm-" + st[i+1]);
         }
       else {
         var pos = 0, i = 0, text = "", style, sg = 0;
@@ -1838,12 +1838,12 @@ var CodeMirror = (function() {
           }
           for (;;) {
             var end = pos + text.length;
-            var apliedStyle = style;
-            if (extraStyle) apliedStyle = style ? style + extraStyle : extraStyle;
-            span(end > upto ? text.slice(0, upto - pos) : text, apliedStyle);
+            var appliedStyle = style;
+            if (extraStyle) appliedStyle = style ? style + extraStyle : extraStyle;
+            span(end > upto ? text.slice(0, upto - pos) : text, appliedStyle);
             if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
             pos = end;
-            text = st[i++]; style = st[i++];
+            text = st[i++]; style = "cm-" + st[i++];
           }
         }
         if (sfrom != null && sto == null) span(" ", "CodeMirror-selected");