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