From a8354dd3d523db6cfb959da43509cc0921b27251 Mon Sep 17 00:00:00 2001 From: lolson Date: Mon, 13 Jul 2015 16:19:57 -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 e59683b..ae0e115 100644 --- a/plugin/makecols.vim +++ b/plugin/makecols.vim @@ -85,27 +85,28 @@ function! s:convert_selection_vert() " 2 6 10 " 3 7 11 let new_string = "" - let row = 1 - let pos = 0 + let row = 0 + let col = 0 while row < rows - let col = 1 + let pos = row echom "ROW: " . row . " COL: " . col . " POS: " . pos - if (row == 0) + if (row == 0 && col == 0) let content = get(old_selection, 0, "blank") let new_string = join([new_string, content], "") + else + let content = get(old_selection, row, "huh") + let new_string = join([new_string, content], "\n") endif - let pos = row + + let col = 0 while col < cols let col += 1 + let pos = pos + rows echom "ROW: " . row . " COL: " . col . " POS: " . pos let content = get(old_selection, pos, "blank") - if (col == 0) - let new_string = join([new_string, content], "") - else - let new_string = join([new_string, content], "\t") - endif - let pos = row + rows + let new_string = join([new_string, content], "\t") endwhile + let new_string = join([new_string,""], "\n") let row += 1 endwhile