Search code examples
codemirror

Make a CodeMirror editor and its gutter 100% height of container


How do I make a CodeMirror editor and its gutter 100% of the height of its parent?

For example, on jsfiddle, the editors have a 100% height gray gutter.

I've gone through the CSS trying to make everything 100% height, but no effect.


Solution

  • A CSS rule like .CodeMirror { height: 100%; } should work. Note that when the parent element changes size after the editor has been initialized, you are responsible for calling .refresh() on your CodeMirror instance to make sure it correctly draws itself.