summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode/clojure
diff options
context:
space:
mode:
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");
});