marijnh/CodeMirror2 — Issue #297: setValue() old height sometimes doesn't change
Author: arosolino
Created: 2011-12-17 20:04:10+00:00
State: open

There is a bug with the setValue() function, I use it to load in new files via Ajax. If the file previously loaded had scroll contents, and I load new contents in sometimes the scroll remains intact, however the gutter is correct.

Here is an example of the first file I load with the scroll bar:
http://gyazo.com/e093fa6d17c51f179e108b333c668716

Once I load ajax the next function and load it with setValue, this is what happens.
http://gyazo.com/3145f9a32a4bcc0c79a598ad72a61dc2

See the scroll bar remains intact, here is some of the code inspected:
http://gyazo.com/8a94a194dd754c93385689e46ed6d68c

Look at the difference in heights, gutter is set to 300 and the other div is set to 1018.

Also this doesn't happen every time, it's like 1/3 times.