In case there is nothing to align, it was failing with an error, this
ensures it exists gracefully in this situation.
This commit is contained in:
Dhruva Sagar
2014-05-10 15:27:36 +05:30
parent 7258a56d20
commit 7eff1e30f1

View File

@@ -106,6 +106,7 @@ function! tablemode#align#alignments(lnum, ncols) "{{{2
endfunction endfunction
function! tablemode#align#Align(lines) "{{{2 function! tablemode#align#Align(lines) "{{{2
if empty(a:lines) | return [] | endif
let lines = map(a:lines, 'map(v:val, "v:key =~# \"text\" ? tablemode#align#Split(v:val, g:table_mode_separator) : v:val")') let lines = map(a:lines, 'map(v:val, "v:key =~# \"text\" ? tablemode#align#Split(v:val, g:table_mode_separator) : v:val")')
for line in lines for line in lines