Limiting the window width

I’m using automatic window sizing, but if I paste in a very very long line, I’d like to limit the window width to a reasonable maximum. How do I do that?

I’m not sure what kind of automatic window resizing you mean. CodeMirror should be used with a fixed width, it’ll do problematic things otherwise.


I’d like line 7 to wrap instead of making the window so very wide.

Did you trying limiting window width in CSS, using something like this?

.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
width: 400px;
float: left;
border: 1px solid black;