From f0e201ef5e68fe7bbac7a7ebf8bba67560c485ed Mon Sep 17 00:00:00 2001 From: lolson Date: Mon, 13 Jul 2015 15:38:01 -0500 Subject: [PATCH] adding features --- plugin/makecols.vim | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/plugin/makecols.vim b/plugin/makecols.vim index 9492496..59dbc33 100644 --- a/plugin/makecols.vim +++ b/plugin/makecols.vim @@ -71,6 +71,7 @@ endfunction function! s:convert_selection_vert() " Setup some variables + let cols = g:makecols_cols let selection = s:get_visual_selection() let old_selection = split(selection, ",") let lines = len(old_selection) * 1.0 @@ -78,25 +79,25 @@ function! s:convert_selection_vert() let rows = float2nr(ceil(rows)) let @z = "" + " 12 item example below + " 0 4 8 " 1 5 9 " 2 6 10 " 3 7 11 - " 4 8 12 let new_string = "" - let c = 0 - while c < g:makecols_cols - let cols = g:makecols_cols + let r = 0 + while row < rows let sec = get(old_selection, c, "") - let i = c - echom "C: " . c - while i < lines - let i = i + rows - echom "I: " . i - let sec = get(old_selection, i, "blank") + let col = row + echom "Row: " . row + while col < cols + let char = col + rows + echom "R" . row . "C" . col + let sec = get(old_selection, char, "blank") let new_string = join([new_string, sec], "\t") endwhile let new_string = join([new_string,""], "\n") - let c += 1 + let row += 1 endwhile return join([new_string, ""], "\n")