diff --git a/autoload/easy_align.vim b/autoload/easy_align.vim index 7bf4ae9..6a0365d 100644 --- a/autoload/easy_align.vim +++ b/autoload/easy_align.vim @@ -511,8 +511,7 @@ function! s:do_align(modes, all_tokens, all_delims, fl, ll, fc, lc, pattern, nth " Determine the left and right margin around the delimiter let rest = join(tokens[nth + 1 : -1], '') let ml = empty(prefix . token) ? '' : a:ml - let mr = (empty(rest) || - \ (empty(rest) && stridx(after, a:mr) == 0)) ? '' : a:mr + let mr = empty(rest.after) ? '' : a:mr " Adjust indentation of the lines starting with a delimiter let lpad = '' diff --git a/test/interactive.vader b/test/interactive.vader index 3733485..732c056 100644 --- a/test/interactive.vader +++ b/test/interactive.vader @@ -1283,3 +1283,16 @@ Expect: a = b = c aabba = bbbbb +Given (Table): + |a|b|c|d| + | -|-|>-|-| + |aaa|bbb|ccc|ddd| + +Do (Partial alignment around 1st |): + \ljj\| + +Expect (Right margin correctly attached): + | a|b|c|d| + | -|-|>-|-| + | aaa|bbb|ccc|ddd| +