From a3aba5100e55f755147df55cc2f2b665ff6f355d Mon Sep 17 00:00:00 2001 From: Dhruva Sagar Date: Mon, 18 Mar 2013 17:57:14 +0530 Subject: [PATCH] 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. --- plugin/table-mode.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/table-mode.vim b/plugin/table-mode.vim index 7c4b707..493d554 100644 --- a/plugin/table-mode.vim +++ b/plugin/table-mode.vim @@ -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()