code: function onResize(cm) {
    let d = cm.display
    // Might be a text scaling operation, clear size caches.
    d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
    d.scrollbarsClipped = false
    cm.setSize()
  }
docs: Called when the window resizes