{"title":"$:/plugins/tiddlywiki/codemirror-keymap-sublime-text","name":"CodeMirror Keymap Sublime Text","description":"Keymap compatible with Sublime Text for CodeMirror","parent-plugin":"$:/plugins/tiddlywiki/codemirror","dependents":"$:/plugins/tiddlywiki/codemirror-search-replace $:/plugins/tiddlywiki/codemirror-closebrackets","list":"readme","version":"5.2.2","plugin-type":"plugin","type":"application/json","tiddlers":{"$:/config/codemirror/extraKeysTW":{"title":"$:/config/codemirror/extraKeysTW","extend":"extraKeys","type":"json","text":"{\n\t\"Ctrl-M\": \"\",\n\t\"Alt-M\": \"goToBracket\",\n\t\"Ctrl-Enter\": \"\",\n\t\"Shift-Enter\": \"insertLineAfter\",\n\t\"Esc\": \"\",\n\t\"Ctrl-Esc\": \"singleSelectionTop\",\n\t\"Ctrl-L\": \"\",\n\t\"Shift-Ctrl-L\": \"\",\n\t\"Alt-L\": \"selectLine\",\n\t\"Shift-Alt-L\": \"splitSelectionByLine\",\n\t\"Ctrl-T\": \"\",\n\t\"Alt-T\": \"transposeChars\",\n\t\"Ctrl-K Ctrl-U\": \"\",\n\t\"Ctrl-K Ctrl-L\": \"\",\n\t\"Ctrl-K Ctrl-W\": \"\",\n\t\"Ctrl-K Alt-U\": \"upcaseAtCursor\",\n\t\"Ctrl-K Alt-L\": \"downcaseAtCursor\",\n\t\"Ctrl-K Alt-D\": \"deleteToSublimeMark\"\n}\n"},"$:/plugins/tiddlywiki/codemirror/keymaps/sublime":{"title":"$:/plugins/tiddlywiki/codemirror/keymaps/sublime","module-type":"codemirror-keymap","text":"sublime\n"},"$:/plugins/tiddlywiki/codemirror/keymap/sublime.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(e){\"object\"==typeof exports&&\"object\"==typeof module?e(require(\"../lib/codemirror\"),require(\"../addon/search/searchcursor\"),require(\"../addon/edit/matchbrackets\")):\"function\"==typeof define&&define.amd?define([\"../lib/codemirror\",\"../addon/search/searchcursor\",\"../addon/edit/matchbrackets\"],e):e(CodeMirror)}(function(u){\"use strict\";var r=u.commands,d=u.Pos;function t(t,n){t.extendSelectionsBy(function(e){return t.display.shift||t.doc.extend||e.empty()?function(e,t,n){if(n<0&&0==t.ch)return e.clipPos(d(t.line-1));var r=e.getLine(t.line);if(0<n&&t.ch>=r.length)return e.clipPos(d(t.line+1,0));for(var o,i=\"start\",l=t.ch,a=l,s=n<0?0:r.length;a!=s;a+=n,0){var c=r.charAt(n<0?a-1:a),f=\"_\"!=c&&u.isWordChar(c)?\"w\":\"o\";if(\"w\"==f&&c.toUpperCase()==c&&(f=\"W\"),\"start\"==i)\"o\"!=f?(i=\"in\",o=f):l=a+n;else if(\"in\"==i&&o!=f){if(\"w\"==o&&\"W\"==f&&n<0&&a--,\"W\"==o&&\"w\"==f&&0<n){if(a==l+1){o=\"w\";continue}a--}break}}return d(t.line,a)}(t.doc,e.head,n):n<0?e.from():e.to()})}function n(l,a){if(l.isReadOnly())return u.Pass;l.operation(function(){for(var e=l.listSelections().length,t=[],n=-1,r=0;r<e;r++){var o,i=l.listSelections()[r].head;i.line<=n||(o=d(i.line+(a?0:1),0),l.replaceRange(\"\\n\",o,null,\"+insertLine\"),l.indentLine(o.line,null,!0),t.push({head:o,anchor:o}),n=i.line+1)}l.setSelections(t)}),l.execCommand(\"indentAuto\")}function c(e,t){for(var n=t.ch,r=n,o=e.getLine(t.line);n&&u.isWordChar(o.charAt(n-1));)--n;for(;r<o.length&&u.isWordChar(o.charAt(r));)++r;return{from:d(t.line,n),to:d(t.line,r),word:o.slice(n,r)}}function o(e,t){for(var n=e.listSelections(),r=[],o=0;o<n.length;o++){var i=n[o],l=e.findPosV(i.anchor,t,\"line\",i.anchor.goalColumn),a=e.findPosV(i.head,t,\"line\",i.head.goalColumn);l.goalColumn=null!=i.anchor.goalColumn?i.anchor.goalColumn:e.cursorCoords(i.anchor,\"div\").left,a.goalColumn=null!=i.head.goalColumn?i.head.goalColumn:e.cursorCoords(i.head,\"div\").left;var s={anchor:l,head:a};r.push(i),r.push(s)}e.setSelections(r)}r.goSubwordLeft=function(e){t(e,-1)},r.goSubwordRight=function(e){t(e,1)},r.scrollLineUp=function(e){var t,n=e.getScrollInfo();e.somethingSelected()||(t=e.lineAtHeight(n.top+n.clientHeight,\"local\"),e.getCursor().line>=t&&e.execCommand(\"goLineUp\")),e.scrollTo(null,n.top-e.defaultTextHeight())},r.scrollLineDown=function(e){var t,n=e.getScrollInfo();e.somethingSelected()||(t=e.lineAtHeight(n.top,\"local\")+1,e.getCursor().line<=t&&e.execCommand(\"goLineDown\")),e.scrollTo(null,n.top+e.defaultTextHeight())},r.splitSelectionByLine=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var o=t[r].from(),i=t[r].to(),l=o.line;l<=i.line;++l)i.line>o.line&&l==i.line&&0==i.ch||n.push({anchor:l==o.line?o:d(l,0),head:l==i.line?i:d(l)});e.setSelections(n,0)},r.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},r.selectLine=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var o=t[r];n.push({anchor:d(o.from().line,0),head:d(o.to().line+1,0)})}e.setSelections(n)},r.insertLineAfter=function(e){return n(e,!1)},r.insertLineBefore=function(e){return n(e,!0)},r.selectNextOccurrence=function(e){var t=e.getCursor(\"from\"),n=e.getCursor(\"to\"),r=e.state.sublimeFindFullWord==e.doc.sel;if(0==u.cmpPos(t,n)){var o=c(e,t);if(!o.word)return;e.setSelection(o.from,o.to),r=!0}else{var i=e.getRange(t,n),l=r?new RegExp(\"\\\\b\"+i+\"\\\\b\"):i,a=e.getSearchCursor(l,n);if(!(a.findNext()||(a=e.getSearchCursor(l,d(e.firstLine(),0))).findNext())||function(e,t,n){for(var r=0;r<e.length;r++)if(0==u.cmpPos(e[r].from(),t)&&0==u.cmpPos(e[r].to(),n))return!0;return!1}(e.listSelections(),a.from(),a.to()))return;e.addSelection(a.from(),a.to())}r&&(e.state.sublimeFindFullWord=e.doc.sel)},r.skipAndSelectNextOccurrence=function(e){var t=e.getCursor(\"anchor\"),n=e.getCursor(\"head\");r.selectNextOccurrence(e),0!=u.cmpPos(t,n)&&e.doc.setSelections(e.doc.listSelections().filter(function(e){return e.anchor!=t||e.head!=n}))},r.addCursorToPrevLine=function(e){o(e,-1)},r.addCursorToNextLine=function(e){o(e,1)};var f=\"(){}[]\";function i(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var o=t[r],i=o.head,l=e.scanForBracket(i,-1);if(!l)return;for(;;){var a=e.scanForBracket(i,1);if(!a)return;if(a.ch==f.charAt(f.indexOf(l.ch)+1)){var s=d(l.pos.line,l.pos.ch+1);if(0!=u.cmpPos(s,o.from())||0!=u.cmpPos(a.pos,o.to())){n.push({anchor:s,head:a.pos});break}if(!(l=e.scanForBracket(l.pos,-1)))return}i=d(a.pos.line,a.pos.ch+1)}}return e.setSelections(n),1}function l(e){return e?/\\bpunctuation\\b/.test(e)?e:void 0:null}function a(a,s){if(a.isReadOnly())return u.Pass;for(var c,e=a.listSelections(),f=[],t=0;t<e.length;t++){var n=e[t];if(!n.empty()){for(var r=n.from().line,o=n.to().line;t<e.length-1&&e[t+1].from().line==o;)o=e[++t].to().line;e[t].to().ch||o--,f.push(r,o)}}f.length?c=!0:f.push(a.firstLine(),a.lastLine()),a.operation(function(){for(var e=[],t=0;t<f.length;t+=2){var n=f[t],r=f[t+1],o=d(n,0),i=d(r),l=a.getRange(o,i,!1);s?l.sort():l.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),e<t?-1:e==t?0:1}),a.replaceRange(l,o,i),c&&e.push({anchor:o,head:d(r+1,0)})}c&&a.setSelections(e,0)})}function s(a,s){a.operation(function(){for(var e=a.listSelections(),t=[],n=[],r=0;r<e.length;r++){(l=e[r]).empty()?(t.push(r),n.push(\"\")):n.push(s(a.getRange(l.from(),l.to())))}a.replaceSelections(n,\"around\",\"case\");for(r=t.length-1;0<=r;r--){var o,i,l=e[t[r]];i&&0<u.cmpPos(l.head,i)||(i=(o=c(a,l.head)).from,a.replaceRange(s(o.word),o.from,o.to))}})}function m(e){var t=e.getCursor(\"from\"),n=e.getCursor(\"to\");if(0==u.cmpPos(t,n)){var r=c(e,t);if(!r.word)return;t=r.from,n=r.to}return{from:t,to:n,query:e.getRange(t,n),word:r}}function h(e,t){var n,r,o=m(e);o&&(n=o.query,r=e.getSearchCursor(n,t?o.to:o.from),(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):(r=e.getSearchCursor(n,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):o.word&&e.setSelection(o.from,o.to)))}r.selectScope=function(e){i(e)||e.execCommand(\"selectAll\")},r.selectBetweenBrackets=function(e){if(!i(e))return u.Pass},r.goToBracket=function(r){r.extendSelectionsBy(function(e){var t=r.scanForBracket(e.head,1,l(r.getTokenTypeAt(e.head)));if(t&&0!=u.cmpPos(t.pos,e.head))return t.pos;var n=r.scanForBracket(e.head,-1,l(r.getTokenTypeAt(d(e.head.line,e.head.ch+1))));return n&&d(n.pos.line,n.pos.ch+1)||e.head})},r.swapLineUp=function(o){if(o.isReadOnly())return u.Pass;for(var e=o.listSelections(),i=[],t=o.firstLine()-1,l=[],n=0;n<e.length;n++){var r=e[n],a=r.from().line-1,s=r.to().line;l.push({anchor:d(r.anchor.line-1,r.anchor.ch),head:d(r.head.line-1,r.head.ch)}),0!=r.to().ch||r.empty()||--s,t<a?i.push(a,s):i.length&&(i[i.length-1]=s),t=s}o.operation(function(){for(var e=0;e<i.length;e+=2){var t=i[e],n=i[e+1],r=o.getLine(t);o.replaceRange(\"\",d(t,0),d(t+1,0),\"+swapLine\"),n>o.lastLine()?o.replaceRange(\"\\n\"+r,d(o.lastLine()),null,\"+swapLine\"):o.replaceRange(r+\"\\n\",d(n,0),null,\"+swapLine\")}o.setSelections(l),o.scrollIntoView()})},r.swapLineDown=function(o){if(o.isReadOnly())return u.Pass;for(var e=o.listSelections(),i=[],t=o.lastLine()+1,n=e.length-1;0<=n;n--){var r=e[n],l=r.to().line+1,a=r.from().line;0!=r.to().ch||r.empty()||l--,l<t?i.push(l,a):i.length&&(i[i.length-1]=a),t=a}o.operation(function(){for(var e=i.length-2;0<=e;e-=2){var t=i[e],n=i[e+1],r=o.getLine(t);t==o.lastLine()?o.replaceRange(\"\",d(t-1),d(t),\"+swapLine\"):o.replaceRange(\"\",d(t,0),d(t+1,0),\"+swapLine\"),o.replaceRange(r+\"\\n\",d(n,0),null,\"+swapLine\")}o.scrollIntoView()})},r.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},r.joinLines=function(s){for(var e=s.listSelections(),c=[],t=0;t<e.length;t++){for(var n=e[t],r=n.from(),o=r.line,i=n.to().line;t<e.length-1&&e[t+1].from().line==i;)i=e[++t].to().line;c.push({start:o,end:i,anchor:!n.empty()&&r})}s.operation(function(){for(var e=0,t=[],n=0;n<c.length;n++){for(var r,o=c[n],i=o.anchor&&d(o.anchor.line-e,o.anchor.ch),l=o.start;l<=o.end;l++){var a=l-e;l==o.end&&(r=d(a,s.getLine(a).length+1)),a<s.lastLine()&&(s.replaceRange(\" \",d(a),d(1+a,/^\\s*/.exec(s.getLine(1+a))[0].length)),++e)}t.push({anchor:i||r,head:r})}s.setSelections(t,0)})},r.duplicateLine=function(r){r.operation(function(){for(var e=r.listSelections().length,t=0;t<e;t++){var n=r.listSelections()[t];n.empty()?r.replaceRange(r.getLine(n.head.line)+\"\\n\",d(n.head.line,0)):r.replaceRange(r.getRange(n.from(),n.to()),n.from())}r.scrollIntoView()})},r.sortLines=function(e){a(e,!0)},r.sortLinesInsensitive=function(e){a(e,!1)},r.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},r.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},r.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var o=t[r].from(),i=t[r].to(),l=t[r].empty()?e.findMarksAt(o):e.findMarks(o,i),a=0;a<l.length;a++)if(l[a].sublimeBookmark){l[a].clear();for(var s=0;s<n.length;s++)n[s]==l[a]&&n.splice(s--,1);break}a==l.length&&n.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},r.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},r.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r].find();o?n.push({anchor:o.from,head:o.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},r.smartBackspace=function(s){if(s.somethingSelected())return u.Pass;s.operation(function(){for(var e=s.listSelections(),t=s.getOption(\"indentUnit\"),n=e.length-1;0<=n;n--){var r,o=e[n].head,i=s.getRange({line:o.line,ch:0},o),l=u.countColumn(i,null,s.getOption(\"tabSize\")),a=s.findPosH(o,-1,\"char\",!1);!i||/\\S/.test(i)||l%t!=0||(r=new d(o.line,u.findColumn(i,l-t,t))).ch!=o.ch&&(a=r),s.replaceRange(\"\",a,o,\"+delete\")}})},r.delLineRight=function(n){n.operation(function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(\"\",e[t].anchor,d(e[t].to().line),\"+delete\");n.scrollIntoView()})},r.upcaseAtCursor=function(e){s(e,function(e){return e.toUpperCase()})},r.downcaseAtCursor=function(e){s(e,function(e){return e.toLowerCase()})},r.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},r.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},r.deleteToSublimeMark=function(e){var t,n,r,o=e.state.sublimeMark&&e.state.sublimeMark.find();o&&(r=e.getCursor(),n=o,0<u.cmpPos(r,n)&&(t=n,n=r,r=t),e.state.sublimeKilled=e.getRange(r,n),e.replaceRange(\"\",r,n))},r.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},r.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,\"paste\")},r.showInCenter=function(e){var t=e.cursorCoords(null,\"local\");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},r.findUnder=function(e){h(e,!0)},r.findUnderPrevious=function(e){h(e,!1)},r.findAllUnder=function(e){var t=m(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}};var e=u.keyMap;e.macSublime={\"Cmd-Left\":\"goLineStartSmart\",\"Shift-Tab\":\"indentLess\",\"Shift-Ctrl-K\":\"deleteLine\",\"Alt-Q\":\"wrapLines\",\"Ctrl-Left\":\"goSubwordLeft\",\"Ctrl-Right\":\"goSubwordRight\",\"Ctrl-Alt-Up\":\"scrollLineUp\",\"Ctrl-Alt-Down\":\"scrollLineDown\",\"Cmd-L\":\"selectLine\",\"Shift-Cmd-L\":\"splitSelectionByLine\",Esc:\"singleSelectionTop\",\"Cmd-Enter\":\"insertLineAfter\",\"Shift-Cmd-Enter\":\"insertLineBefore\",\"Cmd-D\":\"selectNextOccurrence\",\"Shift-Cmd-Space\":\"selectScope\",\"Shift-Cmd-M\":\"selectBetweenBrackets\",\"Cmd-M\":\"goToBracket\",\"Cmd-Ctrl-Up\":\"swapLineUp\",\"Cmd-Ctrl-Down\":\"swapLineDown\",\"Cmd-/\":\"toggleCommentIndented\",\"Cmd-J\":\"joinLines\",\"Shift-Cmd-D\":\"duplicateLine\",F5:\"sortLines\",\"Cmd-F5\":\"sortLinesInsensitive\",F2:\"nextBookmark\",\"Shift-F2\":\"prevBookmark\",\"Cmd-F2\":\"toggleBookmark\",\"Shift-Cmd-F2\":\"clearBookmarks\",\"Alt-F2\":\"selectBookmarks\",Backspace:\"smartBackspace\",\"Cmd-K Cmd-D\":\"skipAndSelectNextOccurrence\",\"Cmd-K Cmd-K\":\"delLineRight\",\"Cmd-K Cmd-U\":\"upcaseAtCursor\",\"Cmd-K Cmd-L\":\"downcaseAtCursor\",\"Cmd-K Cmd-Space\":\"setSublimeMark\",\"Cmd-K Cmd-A\":\"selectToSublimeMark\",\"Cmd-K Cmd-W\":\"deleteToSublimeMark\",\"Cmd-K Cmd-X\":\"swapWithSublimeMark\",\"Cmd-K Cmd-Y\":\"sublimeYank\",\"Cmd-K Cmd-C\":\"showInCenter\",\"Cmd-K Cmd-G\":\"clearBookmarks\",\"Cmd-K Cmd-Backspace\":\"delLineLeft\",\"Cmd-K Cmd-1\":\"foldAll\",\"Cmd-K Cmd-0\":\"unfoldAll\",\"Cmd-K Cmd-J\":\"unfoldAll\",\"Ctrl-Shift-Up\":\"addCursorToPrevLine\",\"Ctrl-Shift-Down\":\"addCursorToNextLine\",\"Cmd-F3\":\"findUnder\",\"Shift-Cmd-F3\":\"findUnderPrevious\",\"Alt-F3\":\"findAllUnder\",\"Shift-Cmd-[\":\"fold\",\"Shift-Cmd-]\":\"unfold\",\"Cmd-I\":\"findIncremental\",\"Shift-Cmd-I\":\"findIncrementalReverse\",\"Cmd-H\":\"replace\",F3:\"findNext\",\"Shift-F3\":\"findPrev\",fallthrough:\"macDefault\"},u.normalizeKeyMap(e.macSublime),e.pcSublime={\"Shift-Tab\":\"indentLess\",\"Shift-Ctrl-K\":\"deleteLine\",\"Alt-Q\":\"wrapLines\",\"Ctrl-T\":\"transposeChars\",\"Alt-Left\":\"goSubwordLeft\",\"Alt-Right\":\"goSubwordRight\",\"Ctrl-Up\":\"scrollLineUp\",\"Ctrl-Down\":\"scrollLineDown\",\"Ctrl-L\":\"selectLine\",\"Shift-Ctrl-L\":\"splitSelectionByLine\",Esc:\"singleSelectionTop\",\"Ctrl-Enter\":\"insertLineAfter\",\"Shift-Ctrl-Enter\":\"insertLineBefore\",\"Ctrl-D\":\"selectNextOccurrence\",\"Shift-Ctrl-Space\":\"selectScope\",\"Shift-Ctrl-M\":\"selectBetweenBrackets\",\"Ctrl-M\":\"goToBracket\",\"Shift-Ctrl-Up\":\"swapLineUp\",\"Shift-Ctrl-Down\":\"swapLineDown\",\"Ctrl-/\":\"toggleCommentIndented\",\"Ctrl-J\":\"joinLines\",\"Shift-Ctrl-D\":\"duplicateLine\",F9:\"sortLines\",\"Ctrl-F9\":\"sortLinesInsensitive\",F2:\"nextBookmark\",\"Shift-F2\":\"prevBookmark\",\"Ctrl-F2\":\"toggleBookmark\",\"Shift-Ctrl-F2\":\"clearBookmarks\",\"Alt-F2\":\"selectBookmarks\",Backspace:\"smartBackspace\",\"Ctrl-K Ctrl-D\":\"skipAndSelectNextOccurrence\",\"Ctrl-K Ctrl-K\":\"delLineRight\",\"Ctrl-K Ctrl-U\":\"upcaseAtCursor\",\"Ctrl-K Ctrl-L\":\"downcaseAtCursor\",\"Ctrl-K Ctrl-Space\":\"setSublimeMark\",\"Ctrl-K Ctrl-A\":\"selectToSublimeMark\",\"Ctrl-K Ctrl-W\":\"deleteToSublimeMark\",\"Ctrl-K Ctrl-X\":\"swapWithSublimeMark\",\"Ctrl-K Ctrl-Y\":\"sublimeYank\",\"Ctrl-K Ctrl-C\":\"showInCenter\",\"Ctrl-K Ctrl-G\":\"clearBookmarks\",\"Ctrl-K Ctrl-Backspace\":\"delLineLeft\",\"Ctrl-K Ctrl-1\":\"foldAll\",\"Ctrl-K Ctrl-0\":\"unfoldAll\",\"Ctrl-K Ctrl-J\":\"unfoldAll\",\"Ctrl-Alt-Up\":\"addCursorToPrevLine\",\"Ctrl-Alt-Down\":\"addCursorToNextLine\",\"Ctrl-F3\":\"findUnder\",\"Shift-Ctrl-F3\":\"findUnderPrevious\",\"Alt-F3\":\"findAllUnder\",\"Shift-Ctrl-[\":\"fold\",\"Shift-Ctrl-]\":\"unfold\",\"Ctrl-I\":\"findIncremental\",\"Shift-Ctrl-I\":\"findIncrementalReverse\",\"Ctrl-H\":\"replace\",F3:\"findNext\",\"Shift-F3\":\"findPrev\",fallthrough:\"pcDefault\"},u.normalizeKeyMap(e.pcSublime);var C=e.default==e.macDefault;e.sublime=C?e.macSublime:e.pcSublime});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/keymap/sublime.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror/addons/comment/comment.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(e){\"object\"==typeof exports&&\"object\"==typeof module?e(require(\"../../lib/codemirror\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\"],e):e(CodeMirror)}(function(e){\"use strict\";var S={},y=/[^\\s\\u00a0]/,E=e.Pos,u=e.cmpPos;function f(e){var n=e.search(y);return-1==n?0:n}function M(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension(\"toggleComment\",function(e){e=e||S;for(var n=this,t=1/0,i=this.listSelections(),l=null,o=i.length-1;0<=o;o--){var r=i[o].from(),m=i[o].to();r.line>=t||(m.line>=t&&(m=E(t,0)),t=r.line,null==l?l=n.uncomment(r,m,e)?\"un\":(n.lineComment(r,m,e),\"line\"):\"un\"==l?n.uncomment(r,m,e):n.lineComment(r,m,e))}}),e.defineExtension(\"lineComment\",function(o,e,r){r=r||S;var n,t,m,a,c,g,s=this,i=M(s,o),l=s.getLine(o.line);null!=l&&(n=o,t=l,!/\\bstring\\b/.test(s.getTokenTypeAt(E(n.line,0)))||/^[\\'\\\"\\`]/.test(t))&&((m=r.lineComment||i.lineComment)?(a=Math.min(0!=e.ch||e.line==o.line?e.line+1:e.line,s.lastLine()+1),c=null==r.padding?\" \":r.padding,g=r.commentBlankLines||o.line==e.line,s.operation(function(){if(r.indent){for(var e=null,n=o.line;n<a;++n){var t=(i=s.getLine(n)).slice(0,f(i));(null==e||e.length>t.length)&&(e=t)}for(n=o.line;n<a;++n){var i=s.getLine(n),l=e.length;(g||y.test(i))&&(i.slice(0,l)!=e&&(l=f(i)),s.replaceRange(e+m+c,E(n,0),E(n,l)))}}else for(n=o.line;n<a;++n)(g||y.test(s.getLine(n)))&&s.replaceRange(m+c,E(n,0))})):(r.blockCommentStart||i.blockCommentStart)&&(r.fullLines=!0,s.blockComment(o,e,r)))}),e.defineExtension(\"blockComment\",function(o,r,m){m=m||S;var a,c,g=this,s=M(g,o),f=m.blockCommentStart||s.blockCommentStart,d=m.blockCommentEnd||s.blockCommentEnd;f&&d?/\\bcomment\\b/.test(g.getTokenTypeAt(E(o.line,0)))||((a=Math.min(r.line,g.lastLine()))!=o.line&&0==r.ch&&y.test(g.getLine(a))&&--a,c=null==m.padding?\" \":m.padding,o.line>a||g.operation(function(){if(0!=m.fullLines){var e=y.test(g.getLine(a));g.replaceRange(c+d,E(a)),g.replaceRange(f+c,E(o.line,0));var n=m.blockCommentLead||s.blockCommentLead;if(null!=n)for(var t=o.line+1;t<=a;++t)t==a&&!e||g.replaceRange(n+c,E(t,0))}else{var i=0==u(g.getCursor(\"to\"),r),l=!g.somethingSelected();g.replaceRange(d,r),i&&g.setSelection(l?r:g.getCursor(\"from\"),r),g.replaceRange(f,o)}})):(m.lineComment||s.lineComment)&&0!=m.fullLines&&g.lineComment(o,r,m)}),e.defineExtension(\"uncomment\",function(e,n,t){t=t||S;var l,o=this,i=M(o,e),r=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,o.lastLine()),m=Math.min(e.line,r),a=t.lineComment||i.lineComment,c=[],g=null==t.padding?\" \":t.padding;e:if(a){for(var s=m;s<=r;++s){var f=o.getLine(s),d=f.indexOf(a);if(-1<d&&!/comment/.test(o.getTokenTypeAt(E(s,d+1)))&&(d=-1),-1==d&&y.test(f))break e;if(-1<d&&y.test(f.slice(0,d)))break e;c.push(f)}if(o.operation(function(){for(var e=m;e<=r;++e){var n=c[e-m],t=n.indexOf(a),i=t+a.length;t<0||(n.slice(i,i+g.length)==g&&(i+=g.length),l=!0,o.replaceRange(\"\",E(e,t),E(e,i)))}}),l)return!0}var u=t.blockCommentStart||i.blockCommentStart,h=t.blockCommentEnd||i.blockCommentEnd;if(!u||!h)return!1;var C=t.blockCommentLead||i.blockCommentLead,p=o.getLine(m),v=p.indexOf(u);if(-1==v)return!1;var b=r==m?p:o.getLine(r),k=b.indexOf(h,r==m?v+u.length:0),L=E(m,v+1),x=E(r,k+1);if(-1==k||!/comment/.test(o.getTokenTypeAt(L))||!/comment/.test(o.getTokenTypeAt(x))||-1<o.getRange(L,x,\"\\n\").indexOf(h))return!1;var R=-1==(T=p.lastIndexOf(u,e.ch))?-1:p.slice(0,e.ch).indexOf(h,T+u.length);if(-1!=T&&-1!=R&&R+h.length!=e.ch)return!1;R=b.indexOf(h,n.ch);var O=b.slice(n.ch).lastIndexOf(u,R-n.ch),T=-1==R||-1==O?-1:n.ch+O;return(-1==R||-1==T||T==n.ch)&&(o.operation(function(){o.replaceRange(\"\",E(r,k-(g&&b.slice(k-g.length,k)==g?g.length:0)),E(r,k+h.length));var e=v+u.length;if(g&&p.slice(e,e+g.length)==g&&(e+=g.length),o.replaceRange(\"\",E(m,v),E(m,e)),C)for(var n=m+1;n<=r;++n){var t,i=o.getLine(n),l=i.indexOf(C);-1==l||y.test(i.slice(0,l))||(t=l+C.length,g&&i.slice(t,t+g.length)==g&&(t+=g.length),o.replaceRange(\"\",E(n,l),E(n,t)))}}),!0)})});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/addons/comment/comment.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror-keymap-sublime-text/readme":{"title":"$:/plugins/tiddlywiki/codemirror-keymap-sublime-text/readme","text":"This plugin adds a ''Keymap'' with the most important ''Sublime Text'' keyboard shortcuts\n\nShortcuts that interfere with ~TiddlyWiki shortcuts differ from the original sublime shortcuts to preserve functionality\n\n\n|Shortcut |Function |h\n|Shift-Tab |indentLess |\n|Shift-Ctrl-K |deleteLine |\n|Alt-Q |wrapLines |\n|Alt-T |transposeChars |\n|Alt-Left |goSubwordLeft |\n|Alt-Right |goSubwordRight |\n|Ctrl-Up |scrollLineUp |\n|Ctrl-Down |scrollLineDown |\n|Alt-L |selectLine |\n|Shift-Alt-L |splitSelectionByLine |\n|Ctrl-Esc |singleSelectionTop |\n|Shift-Enter |insertLineAfter |\n|Shift-Ctrl-Enter |insertLineBefore |\n|Ctrl-D |selectNextOccurrence |\n|Shift-Ctrl-Space |selectScope |\n|Shift-Ctrl-M |selectBetweenBrackets |\n|Alt-M |goToBracket |\n|Shift-Ctrl-Up |swapLineUp |\n|Shift-Ctrl-Down |swapLineDown |\n|Ctrl-/ |toggleCommentIndented |\n|Ctrl-J |joinLines |\n|Shift-Ctrl-D |duplicateLine |\n|F9 |sortLines |\n|Ctrl-F9 |sortLinesInsensitive |\n|F2 |nextBookmark |\n|Shift-F2 |prevBookmark |\n|Ctrl-F2 |toggleBookmark |\n|Shift-Ctrl-F2 |clearBookmarks |\n|Alt-F2 |selectBookmarks |\n|Backspace |smartBackspace |\n|Ctrl-K Ctrl-K |delLineRight |\n|Ctrl-K Alt-U |upcaseAtCursor |\n|Ctrl-K Alt-L |downcaseAtCursor |\n|Ctrl-K Ctrl-Space |setSublimeMark |\n|Ctrl-K Ctrl-A |selectToSublimeMark |\n|Ctrl-K Alt-D |deleteToSublimeMark |\n|Ctrl-K Ctrl-X |swapWithSublimeMark |\n|Ctrl-K Ctrl-Y |sublimeYank |\n|Ctrl-K Ctrl-C |showInCenter |\n|Ctrl-K Ctrl-G |clearBookmarks |\n|Ctrl-K Ctrl-Backspace |delLineLeft |\n|Ctrl-K Ctrl-0 |unfoldAll |\n|Ctrl-K Ctrl-J |unfoldAll |\n|Ctrl-Alt-Up |addCursorToPrevLine |\n|Ctrl-Alt-Down |addCursorToNextLine |\n|Ctrl-F3 |findUnder |\n|Shift-Ctrl-F3 |findUnderPrevious |\n|Shift-Ctrl-[ |fold |\n|Shift-Ctrl-] |unfold |\n|Ctrl-H |replace |\n"}}}