File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -37,28 +37,29 @@ function! GoIndent(lnum)
3737 let previ = indent (prevlnum)
3838
3939 let ind = previ
40+ let s: shiftwidth = shiftwidth ()
4041
4142 if prevl = ~ ' [({]\s*$'
4243 " previous line opened a block
43- let ind += & sw
44+ let ind += s: shiftwidth
4445 endif
4546 if prevl = ~# ' ^\s*\(case .*\|default\):$'
4647 " previous line is part of a switch statement
47- let ind += & sw
48+ let ind += s: shiftwidth
4849 endif
4950 " TODO: handle if the previous line is a label.
5051
5152 if thisl = ~ ' ^\s*[)}]'
5253 " this line closed a block
53- let ind -= & sw
54+ let ind -= s: shiftwidth
5455 endif
5556
5657 " Colons are tricky.
5758 " We want to outdent if it's part of a switch ("case foo:" or "default:").
5859 " We ignore trying to deal with jump labels because (a) they're rare, and
5960 " (b) they're hard to disambiguate from a composite literal key.
6061 if thisl = ~# ' ^\s*\(case .*\|default\):$'
61- let ind -= & sw
62+ let ind -= s: shiftwidth
6263 endif
6364
6465 return ind
You can’t perform that action at this time.
0 commit comments