move a few things away in to-be-integrated/
[myslice.git] / third-party / codemirror-3.15 / addon / edit / matchtags.js
diff --git a/third-party/codemirror-3.15/addon/edit/matchtags.js b/third-party/codemirror-3.15/addon/edit/matchtags.js
deleted file mode 100644 (file)
index 3eabfeb..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-(function() {
-  "use strict";
-
-  CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
-    if (old && old != CodeMirror.Init) {
-      cm.off("cursorActivity", doMatchTags);
-      cm.off("viewportChange", maybeUpdateMatch);
-      clear(cm);
-    }
-    if (val) {
-      cm.on("cursorActivity", doMatchTags);
-      cm.on("viewportChange", maybeUpdateMatch);
-      doMatchTags(cm);
-    }
-  });
-
-  function clear(cm) {
-    if (cm.state.matchedTag) {
-      cm.state.matchedTag.clear();
-      cm.state.matchedTag = null;
-    }
-  }
-
-  function doMatchTags(cm) {
-    cm.state.failedTagMatch = false;
-    cm.operation(function() {
-      clear(cm);
-      var cur = cm.getCursor(), range = cm.getViewport();
-      range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
-      var match = CodeMirror.findMatchingTag(cm, cur, range);
-      if (!match) return;
-      var other = match.at == "close" ? match.open : match.close;
-      if (other)
-        cm.state.matchedTag = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
-      else
-        cm.state.failedTagMatch = true;
-    });
-  }
-
-  function maybeUpdateMatch(cm) {
-    if (cm.state.failedTagMatch) doMatchTags(cm);
-  }
-
-  CodeMirror.commands.toMatchingTag = function(cm) {
-    var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
-    if (found) {
-      var other = found.at == "close" ? found.open : found.close;
-      if (other) cm.setSelection(other.to, other.from);
-    }
-  };
-})();