File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,23 @@ endfunction
65
65
66
66
function ! s: GetClojureIndent ()
67
67
" Move cursor to the first column of the line we want to indent.
68
- call cursor (v: lnum , 0 )
68
+ call cursor (v: lnum , 1 )
69
69
70
70
let s: best_match = [' top' , [0 , 0 ]]
71
71
72
72
let IgnoredRegionFn = function (' <SID>IgnoredRegion' )
73
-
74
73
call s: CheckPair (' lst' , ' (' , ' )' , IgnoredRegionFn)
75
74
call s: CheckPair (' map' , ' {' , ' }' , IgnoredRegionFn)
76
75
call s: CheckPair (' vec' , ' \[' , ' \]' , IgnoredRegionFn)
77
76
78
- let synname = s: GetSynIdName (v: lnum , col (' .' ))
77
+ " Improve accuracy of string detection when a newline is entered.
78
+ if empty (getline (v: lnum ))
79
+ let strline = v: lnum - 1
80
+ let synname = s: GetSynIdName (strline, len (getline (strline)))
81
+ else
82
+ let synname = s: GetSynIdName (v: lnum , 1 )
83
+ endif
84
+
79
85
if synname = ~? ' string'
80
86
call s: CheckPair (' str' , ' "' , ' "' , function (' <SID>NotStringDelimiter' ))
81
87
elseif synname = ~? ' regex'
You can’t perform that action at this time.
0 commit comments