fixes a bug in partial alignment

This commit is contained in:
Junegunn Choi
2013-05-01 23:54:11 +09:00
parent 21ecf9f525
commit 7dc67e5392

View File

@@ -70,7 +70,7 @@ function! s:do_align(fl, ll, fc, lc, pattern, nth, ml, mr, stick_to_left, recurs
let after = a:lc ? strpart(cline, a:lc) : ''
let ml = empty(prefix) ? '' : a:ml
let mr = (empty(suffix . after) || stridx(after, a:mr) == 0) ? '' : a:mr
let mr = (empty(suffix . after) || (empty(suffix) && stridx(after, a:mr) == 0)) ? '' : a:mr
let aligned = join([prefix, ml, delim, mr, suffix], '')
let aligned = empty(after) ? substitute(aligned, '\s*$', '', '') : aligned