From ae157f4a06a38804b0e8fdd637b262bd3769b733 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Mon, 9 Mar 2009 17:23:26 -0400 Subject: [PATCH] Make sure we don't remove all leading indent The 'remove trailing spaces from first field' logic backfired if the first field was all whitespace. --- autoload/tabular.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/tabular.vim b/autoload/tabular.vim index a10ee0c..dd1a623 100644 --- a/autoload/tabular.vim +++ b/autoload/tabular.vim @@ -184,7 +184,9 @@ function! tabular#TabularizeStrings(strings, delim, ...) " intentionally " - Don't strip leading spaces from the first element; we like indenting. for line in lines - let line[0] = s:StripTrailingSpaces(line[0]) + if line[0] !~ '^\s*$' + let line[0] = s:StripTrailingSpaces(line[0]) + endif if len(line) >= 3 for i in range(2, len(line)-1, 2) let line[i] = s:StripLeadingSpaces(s:StripTrailingSpaces(line[i]))