Add 'argument_list' command

This commit is contained in:
Matt Wozniski 2009-03-03 21:44:55 -05:00
parent d28a1791ea
commit f9f6d5bf15

View File

@ -1,8 +1,16 @@
let s:save_cpo = &cpo
set cpo&vim
AddTabularPattern! assignment /[|&+*/%<>=!~-]\@<!\([<>!=]=\|=\~\)\@![|&+*/%<>=!~-]*=/l1r1
AddTabularPattern! two_spaces / /l0
AddTabularPipeline! multiple_spaces / / map(a:lines, "substitute(v:val, ' *', ' ', 'g')") | tabular#TabularizeStrings(a:lines, ' ', 'l0')
AddTabularPipeline! argument_list /(.*)/ map(a:lines, 'substitute(v:val, ''\s*\([(,)]\)\s*'', ''\1'', ''g'')')
\ | tabular#TabularizeStrings(a:lines, '[(,)]', 'l0')
\ | map(a:lines, 'substitute(v:val, ''\(\s*\),'', '',\1 '', "g")')
\ | map(a:lines, 'substitute(v:val, ''\s*)'', ")", "g")')
function! SplitCDeclarations(lines)
let rv = []
for line in a:lines
@ -31,3 +39,6 @@ AddTabularPattern! cpp_io /<<\|>>/l1
AddTabularPattern! pascal_assign /:=/l1
AddTabularPattern! trailing_c_comments /\/\*\|\*\/\|\/\//l1
let &cpo = s:save_cpo
unlet s:save_cpo