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