File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,23 @@ endfunction
6565
6666function ! s: GetClojureIndent ()
6767 " 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 )
6969
7070 let s: best_match = [' top' , [0 , 0 ]]
7171
7272 let IgnoredRegionFn = function (' <SID>IgnoredRegion' )
73-
7473 call s: CheckPair (' lst' , ' (' , ' )' , IgnoredRegionFn)
7574 call s: CheckPair (' map' , ' {' , ' }' , IgnoredRegionFn)
7675 call s: CheckPair (' vec' , ' \[' , ' \]' , IgnoredRegionFn)
7776
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+
7985 if synname = ~? ' string'
8086 call s: CheckPair (' str' , ' "' , ' "' , function (' <SID>NotStringDelimiter' ))
8187 elseif synname = ~? ' regex'
You can’t perform that action at this time.
0 commit comments