Skip to content

Commit

Permalink
Un-break extra highlighted spaces at the end of selected lines
Browse files Browse the repository at this point in the history
These had been broken since the theme system overhaul.
  • Loading branch information
marijnh committed Jul 19, 2011
1 parent 8aad36c commit 0aeaa3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/codemirror.js
Expand Up @@ -1791,7 +1791,7 @@ var CodeMirror = (function() {
html.push(this.className ? '<pre class="' + this.className + '">': "<pre>");
function span(text, style) {
if (!text) return;
if (style) html.push('<span class="cm-', style, '">', htmlEscape(text), "</span>");
if (style) html.push('<span class="', style, '">', htmlEscape(text), "</span>");
else html.push(htmlEscape(text));
}
var st = this.styles, allText = this.text, marked = this.marked;
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 0aeaa3c

Please sign in to comment.