mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-11 11:23:49 -05:00
Fix: right margin sometimes not attached in partial alignment
This commit is contained in:
@@ -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 = ''
|
||||
|
||||
@@ -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 |):
|
||||
\<C-V>ljj\<Enter>|
|
||||
|
||||
Expect (Right margin correctly attached):
|
||||
| a|b|c|d|
|
||||
| -|-|>-|-|
|
||||
| aaa|bbb|ccc|ddd|
|
||||
|
||||
|
||||
Reference in New Issue
Block a user