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

While working on some other functionality I noticed that the logic for deciding whether to recompute the maximum line length didn't seem to be working properly--in particular, as you type on a given line, it wasn't resetting the maximum length. I think it's an off-by-one error due to the fact that doc.iter() excludes the last line in the range you pass to it, hence this proposed fix.

I don't know of a user-visible error that this causes (the scroller seems to update itself properly anyway, because it takes into account the actual width of all descendants)--but some other code that I'm working on in my app depends on the width of the lineSpace being correct. (I know, it probably shouldn't :)) However, it seems worth having the logic be correct here.