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.
This commit is contained in:
parent
f9f6d5bf15
commit
ae157f4a06
@ -184,7 +184,9 @@ function! tabular#TabularizeStrings(strings, delim, ...)
|
|||||||
" intentionally
|
" intentionally
|
||||||
" - Don't strip leading spaces from the first element; we like indenting.
|
" - Don't strip leading spaces from the first element; we like indenting.
|
||||||
for line in lines
|
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
|
if len(line) >= 3
|
||||||
for i in range(2, len(line)-1, 2)
|
for i in range(2, len(line)-1, 2)
|
||||||
let line[i] = s:StripLeadingSpaces(s:StripTrailingSpaces(line[i]))
|
let line[i] = s:StripLeadingSpaces(s:StripTrailingSpaces(line[i]))
|
||||||
|
Loading…
Reference in New Issue
Block a user