!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(i){"use strict";function o(e,n){i.changeEnd(n).line==e.lastLine()&&d(e)}function d(e){var n="";1<e.lineCount()&&(n=e.display.scroller.clientHeight-30-e.getLineHandle(e.lastLine()).height+"px");e.state.scrollPastEndPadding!=n&&(e.state.scrollPastEndPadding=n,e.display.lineSpace.parentNode.style.paddingBottom=n,e.off("refresh",d),e.setSize(),e.on("refresh",d))}i.defineOption("scrollPastEnd",!1,function(e,n,t){t&&t!=i.Init&&(e.off("change",o),e.off("refresh",d),e.display.lineSpace.parentNode.style.paddingBottom="",e.state.scrollPastEndPadding=null),n&&(e.on("change",o),e.on("refresh",d),d(e))})});