Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 0b104ac

Browse files
committed
Support namespace-qualified forms for smart indent
1 parent 7cdae68 commit 0b104ac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

codemirror/clojure-mode.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ CodeMirror.defineMode("clojure", function () {
4747
keyword_char: /[^\s\(\[\;\)\]]/,
4848
basic: /[\w\$_\-\.\*\+\/\?\><!]/,
4949
lang_keyword: /[\w\*\+!\-_?:\/\.#=><]/,
50+
block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/
5051
};
5152

5253
function stateStack(indent, type, prev) { // represents a state stack object
@@ -117,7 +118,7 @@ CodeMirror.defineMode("clojure", function () {
117118
state.mode = "comment";
118119
pushStack(state, indentTemp + INDENT_WORD_SKIP, "comment");
119120
} else if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) ||
120-
/^(?:def|with)/.test(keyWord))) { // indent-word
121+
tests.block_indent.test(keyWord))) { // indent-word
121122
pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
122123
} else { // non-indent word
123124
// we continue eating the spaces

0 commit comments

Comments
 (0)