Skip to content

Commit

Permalink
Fix feedback loop between code.style.width and lineSpace.offsetWidth
Browse files Browse the repository at this point in the history
This would be visible in the activeline demo, where the colored line would get
shorter and shorter for each display update.
  • Loading branch information
marijnh committed Jul 5, 2011
1 parent cd87948 commit 2761c80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/codemirror.js
Expand Up @@ -767,7 +767,7 @@ var CodeMirror = (function() {
var textWidth = stringWidth(maxLine);
lineSpace.style.width = textWidth > scroller.clientWidth ? textWidth + "px" : "";
// Needed to prevent odd wrapping/hiding of widgets placed in here.
code.style.width = (lineSpace.offsetWidth + lineSpace.offsetLeft) + "px";
code.style.width = scroller.scrollWidth + "px";

// Since this is all rather error prone, it is honoured with the
// only assertion in the whole file.
Expand Down

0 comments on commit 2761c80

Please sign in to comment.