endwhile
var [curly, round, squar, outbuf] = [0, 0, 0, ""]
var ready = [strpart(line, 0, brfirst + 1)]
- var trailingComma = v:true
+ var trailingComma = true
for c in split(line[brfirst + 1 : brlast - 1], '\zs')
- if c ==# "*" | trailingComma = v:false | endif
+ if c ==# "*" | trailingComma = false | endif
if outbuf ==# "" && c ==# " " | continue | endif
outbuf ..= c
if c ==# "," && !curly && !round && !squar
elseif c ==# "}" | curly -= 1
endif
endfor
- if trailingComma && !(singleLineComma == v:true && len(ready) == 1)
+ if trailingComma && !(singleLineComma == true && len(ready) == 1)
outbuf = outbuf .. ","
endif
ready = add(ready, prfx .. shift .. outbuf)