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