From 0b104acedb8ef4dedb1ba2eb23001172fa9a948b Mon Sep 17 00:00:00 2001 From: Glen Mailer Date: Sat, 26 Apr 2014 15:40:24 +0100 Subject: [PATCH] Support namespace-qualified forms for smart indent --- codemirror/clojure-mode.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codemirror/clojure-mode.js b/codemirror/clojure-mode.js index 49a33d2..a45abb3 100644 --- a/codemirror/clojure-mode.js +++ b/codemirror/clojure-mode.js @@ -47,6 +47,7 @@ CodeMirror.defineMode("clojure", function () { keyword_char: /[^\s\(\[\;\)\]]/, basic: /[\w\$_\-\.\*\+\/\?\><]/, + block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/ }; function stateStack(indent, type, prev) { // represents a state stack object @@ -117,7 +118,7 @@ CodeMirror.defineMode("clojure", function () { state.mode = "comment"; pushStack(state, indentTemp + INDENT_WORD_SKIP, "comment"); } else 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