Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion autoload/tabular.vim
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ function! tabular#TabularizeStrings(strings, delim, ...)
endfor
endfor

let lead_blank = empty(filter(copy(lines), 'v:val[0] =~ "\\S"'))

" Concatenate the fields, according to the format pattern.
for idx in range(len(lines))
let line = lines[idx]
Expand All @@ -302,7 +304,7 @@ function! tabular#TabularizeStrings(strings, delim, ...)
let field = s:Center(line[i], maxes[i])
endif

let line[i] = field . repeat(" ", pad)
let line[i] = field . (lead_blank && i == 0 ? '' : repeat(" ", pad))
endfor

let prefix = common_indent
Expand Down