(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)})(function(e){function h(a,d,b,c,f){a.openDialog?a.openDialog(d,f,{value:c,selectValueOnOpen:!0,bottom:a.options.search.bottom}):f(prompt(b,c))}function k(a){return a.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+
a.phrase("(Use line:column or scroll% syntax)")+"</span>"}function g(a,d){var b=Number(d);return/^[-+]/.test(d)?a.getCursor().line+b:b-1}e.defineOption("search",{bottom:!1});e.commands.jumpToLine=function(a){var d=a.getCursor();h(a,k(a),a.phrase("Jump to line:"),d.line+1+":"+d.ch,function(b){if(b){var c;(c=/^\s*([\+\-]?\d+)\s*:\s*(\d+)\s*$/.exec(b))?a.setCursor(g(a,c[1]),Number(c[2])):(c=/^\s*([\+\-]?\d+(\.\d+)?)%\s*/.exec(b))?(b=Math.round(a.lineCount()*Number(c[1])/100),/^[-+]/.test(c[1])&&(b=d.line+
b+1),a.setCursor(b-1,d.ch)):(c=/^\s*:?\s*([\+\-]?\d+)\s*/.exec(b))&&a.setCursor(g(a,c[1]),d.ch)}})};e.keyMap["default"]["Alt-G"]="jumpToLine"});
