handling lines w/o delimiters

This commit is contained in:
Junegunn Choi
2013-04-08 11:14:32 +09:00
parent fb777534e0
commit 81f2565da3

View File

@@ -11,6 +11,10 @@ function! s:do_align(fl, ll, pattern, nth, ml, mr, ljust, recursive)
let pattern = '\s*\(' .a:pattern. '\)\s*'
for line in range(a:fl, a:ll)
let tokens = split(getline(line), pattern.'\zs')
if empty(tokens)
continue
endif
let max_tokens = len(tokens) > max_tokens ? len(tokens) : max_tokens
let nth = match(tokens[0], '^\s*$') != -1 ? a:nth + 1 : a:nth