File tree Expand file tree Collapse file tree 3 files changed +15
-14
lines changed
clj/resources/indent-test-cases/reader_conditionals Expand file tree Collapse file tree 3 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 11(def DateTime #? (:clj org.joda.time.DateTime,
22 :cljs goog.date.UtcDateTime))
33
4- #?(:cljs
5- (extend-protocol ToDateTime
6- goog.date.Date
7- ( -to-date-time [x]
8- ( goog.date.UtcDateTime. ( .getYear x) ( .getMonth x) ( .getDate x)) )))
4+ #?(:clj
5+ (defn regexp?
6+ " Returns true if x is a Java regular expression pattern. "
7+ [x]
8+ ( instance? java.util.regex.Pattern x )))
99
1010#?@(:clj [5 6 7 8 ]
11- :cljs [1 2 3 4 ])))
11+ :cljs [1 2 3 4 ])
Original file line number Diff line number Diff line change 11(def DateTime #? (:clj org.joda.time.DateTime,
22 :cljs goog.date.UtcDateTime))
33
4- #?(:cljs
5- (extend-protocol ToDateTime
6- goog.date.Date
7- ( -to-date-time [x]
8- ( goog.date.UtcDateTime. ( .getYear x) ( .getMonth x) ( .getDate x)) )))
4+ #?(:clj
5+ (defn regexp?
6+ " Returns true if x is a Java regular expression pattern. "
7+ [x]
8+ ( instance? java.util.regex.Pattern x )))
99
1010#?@(:clj [5 6 7 8 ]
1111 :cljs [1 2 3 4 ])
Original file line number Diff line number Diff line change @@ -252,6 +252,7 @@ function! s:ListIndent(delim_pos)
252252
253253 let base_indent = s: PosToCharCol (a: delim_pos )
254254 let ln = getline(a:delim_pos[0])
255+ let ln_content = ln [a:delim_pos[1]:]
255256
256257 let sym_match = -1
257258
@@ -268,7 +269,7 @@ function! s:ListIndent(delim_pos)
268269 " other indentation options.
269270
270271 " TODO: simplify this.
271- let syms = split (ln [a:delim_pos[1]:] , '[[:space:],;()\[\]{}@\\"^~`]', 1)
272+ let syms = split (ln_content , ' [[:space:],;()\[\]{}@\\"^~`]' , 1 )
272273
273274 if ! empty (syms)
274275 let sym = syms[0 ]
@@ -292,12 +293,12 @@ function! s:ListIndent(delim_pos)
292293 endif
293294
294295 " 2. Function indentation
295- " if first operand is on the same line?
296+ " if first operand is on the same line? (and not a keyword)
296297 " - Indent subsequent lines to align with first operand.
297298 " else
298299 " - Indent 1 or 2 spaces.
299300 let indent_style = s: Conf (' clojure_indent_style' , ' always-align' )
300- if indent_style !=# ' always-indent'
301+ if indent_style !=# ' always-indent' && ln_content[ 0 ] !=# ' : '
301302 let pos = s: FirstFnArgPos (a: delim_pos )
302303 if pos != [0 , 0 ] | return s: PosToCharCol (pos) - 1 | endif
303304 endif
You can’t perform that action at this time.
0 commit comments