!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 n(e,r){var o=Number(r);return/^[-+]/.test(r)?e.getCursor().line+o:o-1}e.commands.jumpToLine=function(t){var i=t.getCursor();!function(e,r,o,t,i){e.openDialog?e.openDialog(r,i,{value:t,selectValueOnOpen:!0}):i(prompt(o,t))}(t,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>"}(t),t.phrase("Jump to line:"),i.line+1+":"+i.ch,function(e){var r;if(e)if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(e))t.setCursor(n(t,r[1]),Number(r[2]));else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(e)){var o=Math.round(t.lineCount()*Number(r[1])/100);/^[-+]/.test(r[1])&&(o=i.line+o+1),t.setCursor(o-1,i.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(e))&&t.setCursor(n(t,r[1]),i.ch)})},e.keyMap.default["Alt-G"]="jumpToLine"});