!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){"use strict";function o(e,o){var r=Number(o);return/^[-+]/.test(o)?e.getCursor().line+r:r-1}e.defineOption("search",{bottom:!1}),e.commands.jumpToLine=function(e){var r=e.getCursor();!function(e,o,r,t,i){e.openDialog?e.openDialog(o,i,{value:t,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(r,t))}(e,function(e){return e.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use line:column or scroll% syntax)")+"</span>"}(e),e.phrase("Jump to line:"),r.line+1+":"+r.ch,(function(t){var i;if(t)if(i=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(o(e,i[1]),Number(i[2]));else if(i=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var n=Math.round(e.lineCount()*Number(i[1])/100);/^[-+]/.test(i[1])&&(n=r.line+n+1),e.setCursor(n-1,r.ch)}else(i=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(o(e,i[1]),r.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}));