code: function fromCoordSystem(cm, coords, context) {
      if (context == "div") return coords;
      var left = coords.left, top = coords.top;
      if (context == "page") {
        left -= window.pageXOffset || (document.documentElement || document.body).scrollLeft;
        top -= window.pageYOffset || (document.documentElement || document.body).scrollTop;
      }
      var lineSpaceBox = getRect(cm.display.lineSpace);
      left -= lineSpaceBox.left;
      top -= lineSpaceBox.top;
      if (context == "local" || !context) {
        var editorBox = getRect(cm.display.wrapper);
        left += editorBox.left;
        top += editorBox.top;
      }
      return {left: left, top: top};
    }
docs: Context may be "window", "page", "div", or "local"/null Result is in "div" coords