mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-11 19:33:50 -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
|
" Determine the left and right margin around the delimiter
|
||||||
let rest = join(tokens[nth + 1 : -1], '')
|
let rest = join(tokens[nth + 1 : -1], '')
|
||||||
let ml = empty(prefix . token) ? '' : a:ml
|
let ml = empty(prefix . token) ? '' : a:ml
|
||||||
let mr = (empty(rest) ||
|
let mr = empty(rest.after) ? '' : a:mr
|
||||||
\ (empty(rest) && stridx(after, a:mr) == 0)) ? '' : a:mr
|
|
||||||
|
|
||||||
" Adjust indentation of the lines starting with a delimiter
|
" Adjust indentation of the lines starting with a delimiter
|
||||||
let lpad = ''
|
let lpad = ''
|
||||||
|
|||||||
@@ -1283,3 +1283,16 @@ Expect:
|
|||||||
a = b = c
|
a = b = c
|
||||||
aabba = bbbbb
|
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