<tal:block i18n:domain="nive">
<style type="text/css">
.CodeMirror {
  font-size:1.1em;
  line-height:1.3em;
  border: 1px solid #dddddd;
  width: auto;
}
.CodeMirror-scroll {
  min-height: ${field.widget.height}px;
  height: auto;
  overflow-y: scrolling;
  overflow-x: auto;
}
</style>
<textarea class="${field.widget.css_class} ${'is-invalid' if field.error else ''}"
          id="${field.oid}"
          name="${field.name}">${cstruct}</textarea>

<script>
  var editor = CodeMirror.fromTextArea(document.getElementById("${field.oid}"), ${field.widget.renderOptions(field)});
</script>
</tal:block>