diff --git a/plugin/makecols.vim b/plugin/makecols.vim index 76de532..359e3f4 100644 --- a/plugin/makecols.vim +++ b/plugin/makecols.vim @@ -21,10 +21,14 @@ function! s:get_visual_selection() for i in lines " start combining - if (i % no_of_cols) - let new_string = join([new_string, lines[i]], "\t") + if (i == 0) + let new_string = lines[0] else - let new_string = join([new_string, "\n"]) + if (i % no_of_cols) + let new_string = join([new_string, lines[i]], "\t") + else + let new_string = join([new_string, lines[i]], "\n") + endif endif endfor