!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function r(r){r.state.rulerDiv.textContent="";var t=r.getOption("rulers"),l=r.defaultCharWidth(),i=r.charCoords(e.Pos(r.firstLine(),0),"div").left;r.state.rulerDiv.style.minHeight=r.display.scroller.offsetHeight+30+"px";for(var o=0;o<t.length;o++){var s=document.createElement("div");s.className="CodeMirror-ruler";var n,a=t[o];"number"==typeof a?n=a:(n=a.column,a.className&&(s.className+=" "+a.className),a.color&&(s.style.borderColor=a.color),a.lineStyle&&(s.style.borderLeftStyle=a.lineStyle),a.width&&(s.style.borderLeftWidth=a.width)),s.style.left=i+n*l+"px",r.state.rulerDiv.appendChild(s)}}e.defineOption("rulers",!1,(function(e,t){e.state.rulerDiv&&(e.state.rulerDiv.parentElement.removeChild(e.state.rulerDiv),e.state.rulerDiv=null,e.off("refresh",r)),t&&t.length&&(e.state.rulerDiv=e.display.lineSpace.parentElement.insertBefore(document.createElement("div"),e.display.lineSpace),e.state.rulerDiv.className="CodeMirror-rulers",r(e),e.on("refresh",r))}))}));