adobe/CodeMirror2 — pull request #50 by njx (2012-04-04 23:50:33+00:00)
Title: Fix off-by-one error in deciding whether to recompute max line length

@gruehle

While working on some fixes for horizontal scrolling in inline editors, I noticed that CodeMirror didn't seem to be properly recomputing the maximum line length as you type on the longest line. I think it's due to an off-by-one error here--doc.iter() is exclusive of the end of the range you pass it, so if from.line == to.line then the inner function never gets called. This doesn't seem to cause a user-visible bug in CodeMirror, because the scroller updates its scroll size properly anyway based on the sizes of all descendants. But some of the code I'm writing for the inline editor stuff depends on the lineSpace being the correct width.

(I also submitted this as a one-off bug fix to Marijn.)