diff --git a/lib/codemirror.css b/lib/codemirror.css
index c0897771aa9f949b621266072ab5ec454fdfe813..1ab8acb2963cd97ecf5393077ceb8b7bf6d4cc47 100644
--- a/lib/codemirror.css
+++ b/lib/codemirror.css
@@ -213,6 +213,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
 
 .CodeMirror-lines {
   cursor: text;
+  min-height: 1px; /* prevents collapsing before first draw */
 }
 .CodeMirror pre {
   /* Reset some styles that the rest of the page might have set */