CodeMirror reproduction

by ktsn

HTML

<!-- CodeMirror -->
<script src="https://www.unpkg.com/[email protected]/lib/codemirror.js"></script>
<link rel="stylesheet" href="https://www.unpkg.com/[email protected]/lib/codemirror.css"/>

<div id="codemirror"></div>

CSS

html,
body {
  margin: 0;
  height: 100%;
  background: black;
}

#codemirror {
  height: 100%;
}

JavaScript

function init() {
	var el = document.getElementById('codemirror')

  // Create CodeMirror (with lineWrapping on).
  var codeMirror = CodeMirror(el, { lineWrapping: true });
  
  el.style.width = '10px'
  
  codeMirror.setValue(source)
  
  el.style.width = '512px'
  
  codeMirror.refresh()
}





var source = `
 Spot of come to ever hand as lady meet on. Delicate contempt received two yet advanced. Gentleman as belonging he commanded believing dejection in by. On no am winding chicken so behaved. Its preserved sex enjoyment new way behaviour. Him yet devonshire celebrated especially. Unfeeling one provision are smallness resembled repulsive.  Spot of come to ever hand as lady meet on. Delicate contempt received two yet advanced. Gentleman as belonging he commanded believing dejection in by. On no am winding chicken so behaved. Its preserved sex enjoyment new way behaviour. Him yet devonshire celebrated especially. Unfeeling one provision are smallness resembled repulsive.  Spot of come to ever hand as lady meet on. Delicate contempt received two yet advanced. Gentleman as belonging he commanded believing dejection in by. On no am winding chicken so behaved. Its preserved sex enjoyment new way behaviour. Him yet devonshire celebrated especially. Unfeeling one provision are smallness resembled repulsive. 
 
  Spot of come to ever hand as lady meet on. Delicate contempt received two yet advanced. Gentleman as belonging he commanded believing dejection in by. On no am winding chicken so behaved. Its preserved sex enjoyment new way behaviour. Him yet devonshire celebrated especially. Unfeeling one provision are smallness resembled repulsive. 
  
   Spot of come to ever hand as lady meet on. Delicate contempt received two yet advanced. Gentleman as belonging he commanded believing dejection in by. On no am winding chicken so behaved. Its preserved sex enjoyment new way behaviour. Him yet devonshire celebrated especially. Unfeeling one provision are smallness resembled...