Current Directory: /home/astoriaah/www/old15/media/editors/codemirror/addon/selection
Viewing File: /home/astoriaah/www/old15/media/editors/codemirror/addon/selection/active-line.min.js
!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 t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function i(e,i){for(var r=[],s=0;s<i.length;s++){var c=i[s];if(c.empty()){var f=e.getLineHandleVisualStart(c.head.line);r[r.length-1]!=f&&r.push(f)}}n(e.state.activeLines,r)||e.operation(function(){t(e);for(var n=0;n<r.length;n++)e.addLineClass(r[n],"wrap",o),e.addLineClass(r[n],"background",a);e.state.activeLines=r})}function r(e,t){i(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(n,o,a){var s=a&&a!=e.Init;o&&!s?(n.state.activeLines=[],i(n,n.listSelections()),n.on("beforeSelectionChange",r)):!o&&s&&(n.off("beforeSelectionChange",r),t(n),delete n.state.activeLines)})});