Fixed Tableize indentation issue

When applying Tableize on an indented code, the table was created
however the indentation was lost in the process. Earlier the function
s:ConvertDelimiterToSeparator(line) was replace the ^ (start of line),
the g:table_mode_delimiter and $ (end of line) with
g:table_mode_separator and then processing each line for creation of the
table around it, hence since the start of line was replaced it was
causing the indentation to be lost. Fixed this by replacing ^\s*\zs\ze.
(matches just before the first non-blank character) along with
g:table_mode_delimiter and $ and hence the indentation is preserved.
This commit is contained in:
Dhruva Sagar
2013-03-18 17:57:14 +05:30
parent 12700a2a3b
commit a3aba5100e

View File

@@ -115,7 +115,7 @@ function! s:IsTableModeActive()
endfunction
function! s:ConvertDelimiterToSeparator(line)
execute 'silent! ' . a:line . 's/^\|' . g:table_mode_delimiter . '\|$/' . g:table_mode_separator . '/g'
execute 'silent! ' . a:line . 's/^\s*\zs\ze.\|' . g:table_mode_delimiter . '\|$/' . g:table_mode_separator . '/g'
endfunction
function! s:Tableize()