summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode/clojure
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-04-20 18:11:40 +0800
committerCheng-Han, Wu2016-04-20 18:11:40 +0800
commit8bf516263c6582771e7576e8484ca8cfaa8cb9cb (patch)
treeaba81172f554a50466a762db99f25e3650d7ff45 /public/vendor/codemirror/mode/clojure
parentedc3a31dfdb03e910d7355144280e281eeb582d5 (diff)
Update CodeMirror to 5.13.5
Diffstat (limited to 'public/vendor/codemirror/mode/clojure')
-rw-r--r--public/vendor/codemirror/mode/clojure/clojure.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/public/vendor/codemirror/mode/clojure/clojure.js b/public/vendor/codemirror/mode/clojure/clojure.js
index 44948d04..cd8129f7 100644
--- a/public/vendor/codemirror/mode/clojure/clojure.js
+++ b/public/vendor/codemirror/mode/clojure/clojure.js
@@ -59,7 +59,8 @@ CodeMirror.defineMode("clojure", function (options) {
sign: /[+-]/,
exponent: /e/i,
keyword_char: /[^\s\(\[\;\)\]]/,
- symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/
+ symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/,
+ block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/
};
function stateStack(indent, type, prev) { // represents a state stack object
@@ -142,7 +143,7 @@ CodeMirror.defineMode("clojure", function (options) {
}
// skip spaces
- if (stream.eatSpace()) {
+ if (state.mode != "string" && stream.eatSpace()) {
return null;
}
var returnType = null;
@@ -190,7 +191,7 @@ CodeMirror.defineMode("clojure", function (options) {
}
if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) ||
- /^(?:def|with)/.test(keyWord))) { // indent-word
+ tests.block_indent.test(keyWord))) { // indent-word
pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
} else { // non-indent word
// we continue eating the spaces
@@ -243,5 +244,7 @@ CodeMirror.defineMode("clojure", function (options) {
});
CodeMirror.defineMIME("text/x-clojure", "clojure");
+CodeMirror.defineMIME("text/x-clojurescript", "clojure");
+CodeMirror.defineMIME("application/edn", "clojure");
});