Spade
Mini Shell
| Directory:~$ /home/lmsyaran/www/j3/media/editors/codemirror/addon/edit/ |
| [Home] [System Details] [Kill Me] |
!(function(a){"object"==typeof
exports&&"object"==typeof
module?a(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof
define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],a):a(CodeMirror)})((function(a){"use
strict";function
b(a){a.state.tagHit&&a.state.tagHit.clear(),a.state.tagOther&&a.state.tagOther.clear(),a.state.tagHit=a.state.tagOther=null}function
c(c){c.state.failedTagMatch=!1,c.operation((function(){if(b(c),!c.somethingSelected()){var
d=c.getCursor(),e=c.getViewport();e.from=Math.min(e.from,d.line),e.to=Math.max(d.line+1,e.to);var
f=a.findMatchingTag(c,d,e);if(f){if(c.state.matchBothTags){var
g="open"==f.at?f.open:f.close;g&&(c.state.tagHit=c.markText(g.from,g.to,{className:"CodeMirror-matchingtag"}))}var
h="close"==f.at?f.open:f.close;h?c.state.tagOther=c.markText(h.from,h.to,{className:"CodeMirror-matchingtag"}):c.state.failedTagMatch=!0}}}))}function
d(a){a.state.failedTagMatch&&c(a)}a.defineOption("matchTags",!1,(function(e,f,g){g&&g!=a.Init&&(e.off("cursorActivity",c),e.off("viewportChange",d),b(e)),f&&(e.state.matchBothTags="object"==typeof
f&&f.bothTags,e.on("cursorActivity",c),e.on("viewportChange",d),c(e))})),a.commands.toMatchingTag=function(b){var
c=a.findMatchingTag(b,b.getCursor());if(c){var
d="close"==c.at?c.open:c.close;d&&b.extendSelection(d.to,d.from)}}}));