Skip to content

Commit

Permalink
Fix wrapping measuring in Opera
Browse files Browse the repository at this point in the history
Which apparently assigns an offsetLeft of 0 to spans that are wrapped (rather
than using the offset of the first character, as other browsers do)

Closes codemirror#514
  • Loading branch information
marijnh committed May 3, 2012
1 parent 85c2360 commit 1e00968
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -2484,8 +2484,10 @@ var CodeMirror = (function() {
if (wrapWBR) html.push("<wbr>");
}
html.push(open);
span_(text.slice(wrapAt - outPos), style);
var cut = wrapAt - outPos;
span_(window.opera ? text.slice(cut, cut + 1) : text.slice(cut), style);
html.push("</span>");
if (window.opera) span_(text.slice(cut + 1), style);
wrapAt--;
outPos += l;
} else {
Expand Down

0 comments on commit 1e00968

Please sign in to comment.