1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-08-27 19:42:50 +00:00
TiddlyWiki5/plugins/tiddlywiki/codemirror-search-replace/files/addon/search/jump-to-line.js
Simon Huber 769ffa19b7
Update CodeMirror plugins to v5.58.2 (#4950)
* Update codemirror.js to 5.58.2

* Update codemirror.css to 5.58.2

* Update activeline.js to 5.58.2

* Update dialog.js to 5.58.2

* Update jump-to-line.js to 5.58.2

* Update search.js to 5.58.2

* Update searchcursor.js to 5.58.2

* Update xml.js to 5.58.2

* Update show-hint.js to 5.58.2

* Update show-hint.css to 5.58.2

* Update javascript-hint.js to 5.58.2

* Update xml-hint.js to 5.58.2

* Update html-hint.js to 5.58.2

* Update css-hint.js to 5.58.2

* Update anyword-hint.js to 5.58.2

* Update closebrackets.js to 5.58.2

* Update matchbrackets.js to 5.58.2

* Update closetag.js to 5.58.2

* Update xml-fold.js to 5.58.2

* Update fullscreen.js to 5.58.2

* Update emacs.js to 5.58.2

* Update sublime.js to 5.58.2

* Update comment.js to 5.58.2

* Update vim.js to 5.58.2

* Update css.js to 5.58.2

* Update multiplex.js to 5.58.2

* Update htmlembedded.js to 5.58.2

* Update htmlmixed.js to 5.58.2

* Update javascript.js to 5.58.2

* Update markdown.js to 5.58.2

* Update markdown.js

* Update readme.tid

* Update markdown.js
2020-11-01 11:10:00 +00:00

4 lines
1.2 KiB
JavaScript

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
!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,o){var r=Number(o);return/^[-+]/.test(o)?e.getCursor().line+r:r-1}e.commands.jumpToLine=function(t){var e,o,r,s,i,n,l=t.getCursor();o=(n=e=t).phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+n.phrase("(Use line:column or scroll% syntax)")+"</span>",r=t.phrase("Jump to line:"),s=l.line+1+":"+l.ch,i=function(e){var o,r;e&&((o=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(e))?t.setCursor(u(t,o[1]),Number(o[2])):(o=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(e))?(r=Math.round(t.lineCount()*Number(o[1])/100),/^[-+]/.test(o[1])&&(r=l.line+r+1),t.setCursor(r-1,l.ch)):(o=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(e))&&t.setCursor(u(t,o[1]),l.ch))},e.openDialog?e.openDialog(o,i,{value:s,selectValueOnOpen:!0}):i(prompt(r,s))},e.keyMap.default["Alt-G"]="jumpToLine"});