Skip to content

Commit 9ef368c

Browse files
authored
Merge pull request #80 from mhaehnel/dict-parser-update
Add support for lists and quote values in dict
2 parents 7e64387 + 7e172cb commit 9ef368c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

autoload/clang_format.vim

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set cpo&vim
33

44
let s:on_windows = has('win32') || has('win64')
55
let s:dict_t = type({})
6+
let s:list_t = type([])
67
if exists('v:true')
78
let s:bool_t = type(v:true)
89
else
@@ -44,12 +45,12 @@ endfunction
4445
function! s:create_keyvals(key, val) abort
4546
if type(a:val) == s:dict_t
4647
return a:key . ': {' . s:stringize_options(a:val) . '}'
48+
elseif type(a:val) == s:bool_t
49+
return a:key . (a:val == v:true ? ': true' : ': false')
50+
elseif type(a:val) == s:list_t
51+
return a:key . ': [' . join(a:val,',') . ']'
4752
else
48-
if type(a:val) == s:bool_t
49-
return a:key . (a:val == v:true ? ': true' : ': false')
50-
else
51-
return a:key . ': ' . a:val
52-
endif
53+
return a:key . ': ''' . a:val . ''''
5354
endif
5455
endfunction
5556

0 commit comments

Comments
 (0)