I'm trying to allow codemirror to autoresize up to a given number of lines or pixel height. After this max-size is reached the widget should add scrollbars.

```
CodeMirror.fromTextArea(document.getElementById("code"), {
   lineNumbers: true,
   viewportMargin: 50

```

});

max-height is not working

```
.CodeMirror {
 border: 1px solid #eee;
 height: 100%;
}

```

<http://jsfiddle.net/qzjo4ejh/>