'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],a):a(CodeMirror)})(function(a){function k(d,b,a,e){d.openDialog?d.openDialog(b,e):e(prompt(a,""))}var c=a.keyMap.pcDefault,g=a.keyMap.macDefault,h=a.Pos;a.commands.splitSelection=function(d){for(var b=[],a=d.getCursor("from"),e=d.getCursor("to"),f=a.line;f<=e.line;++f)b.push({anchor:f==a.line?a:h(f,0),head:f==e.line?e:h(f)});
d.setSelections(b,0)};a.commands.addNextOccurrenceToSelection=function(a){var b=a.getCursor("to"),b=a.getSearchCursor(a.getRange(a.getCursor("from"),b),b);b.findNext()&&a.addSelection(b.from(),b.to())};a.commands.selectMatchingPartsOfCurrentSelection=function(a){a.somethingSelected()&&k(a,'Match: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp)</span>',"Match:",function(b){var c=b.match(/^\/(.*)\/([a-z]*)$/);c&&(b=new RegExp(c[1],-1==c[2].indexOf("i")?
"":"i"));a.selectMatches(b)})};c["Shift-Ctrl-L"]=g["Shift-Cmd-L"]="splitSelection";c["Ctrl-D"]=g["Cmd-D"]="addNextOccurrenceToSelection";c["Alt-F"]=g["Alt-F"]="selectMatchingPartsOfCurrentSelection"});
