mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-10 19:03:50 -05:00
Do not attach margin_left string before phantom token
This commit is contained in:
@@ -513,8 +513,9 @@ function! s:do_align(todo, modes, all_tokens, all_delims, fl, ll, fc, lc, nth, r
|
|||||||
|
|
||||||
" 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) ? '' : d.ml
|
let nomore = empty(rest.after)
|
||||||
let mr = empty(rest.after) ? '' : d.mr
|
let ml = (empty(prefix . token) || empty(delim) && nomore) ? '' : d.ml
|
||||||
|
let mr = nomore ? '' : d.mr
|
||||||
|
|
||||||
" Adjust indentation of the lines starting with a delimiter
|
" Adjust indentation of the lines starting with a delimiter
|
||||||
let lpad = ''
|
let lpad = ''
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ Execute (merge different option notations):
|
|||||||
%EasyAlign*/../iu0 { 'l': '<', 'r': '>' }
|
%EasyAlign*/../iu0 { 'l': '<', 'r': '>' }
|
||||||
|
|
||||||
Expect:
|
Expect:
|
||||||
ap><pl><e;><:;><;b><an><an><a:><:c><ak>e<
|
ap><pl><e;><:;><;b><an><an><a:><:c><ak>e
|
||||||
da><ta><;;><ex><ch><an><ge><:;><::><fo> <rm><at<
|
da><ta><;;><ex><ch><an><ge><:;><::><fo> <rm><at
|
||||||
|
|
||||||
Given javascript (json):
|
Given javascript (json):
|
||||||
var jdbc = {
|
var jdbc = {
|
||||||
|
|||||||
@@ -19,3 +19,24 @@ Execute (Aligning lines with many delimiters should not fail):
|
|||||||
%EasyAlign*|
|
%EasyAlign*|
|
||||||
AssertEqual (&maxfuncdepth + 1) * 3 - 2, len(getline(1))
|
AssertEqual (&maxfuncdepth + 1) * 3 - 2, len(getline(1))
|
||||||
|
|
||||||
|
Given:
|
||||||
|
a | b | c
|
||||||
|
aa | bb | cc
|
||||||
|
|
||||||
|
Execute:
|
||||||
|
%EasyAlign*|iu0{'l':'<', 'r': '>'}
|
||||||
|
|
||||||
|
Expect:
|
||||||
|
a <|>b <|>c
|
||||||
|
aa<|>bb<|>cc
|
||||||
|
|
||||||
|
Given (Trailing delimiter):
|
||||||
|
a | b | c |
|
||||||
|
aa | bb | cc |
|
||||||
|
|
||||||
|
Execute:
|
||||||
|
%EasyAlign*|iu0{'l':'<', 'r': '>'}
|
||||||
|
|
||||||
|
Expect:
|
||||||
|
a <|>b <|>c <|
|
||||||
|
aa<|>bb<|>cc<|
|
||||||
|
|||||||
@@ -517,15 +517,15 @@ Do (live interactive mode!):
|
|||||||
\<C-X>
|
\<C-X>
|
||||||
|
|
||||||
Expect:
|
Expect:
|
||||||
[|] Option[|]Type [|]Default[|]Description [|[
|
[|] Option[|]Type [|]Default[|]Description [|
|
||||||
[|] --[|]-- [|] --[|]-- [|[
|
[|] --[|]-- [|] --[|]-- [|
|
||||||
[|] threads[|]Fixnum [|] 1[|]number of threads in the thread pool [|[
|
[|] threads[|]Fixnum [|] 1[|]number of threads in the thread pool [|
|
||||||
[|] queues[|]Fixnum [|] 1[|]number of concurrent queues [|[
|
[|] queues[|]Fixnum [|] 1[|]number of concurrent queues [|
|
||||||
[|]queue_size[|]Fixnum [|] 1000[|]size of each queue [|[
|
[|]queue_size[|]Fixnum [|] 1000[|]size of each queue [|
|
||||||
[|] interval[|]Numeric[|] 0[|]dispatcher interval for batch processing [|[
|
[|] interval[|]Numeric[|] 0[|]dispatcher interval for batch processing [|
|
||||||
[|] batch[|]Boolean[|] false[|]enables batch processing mode [|[
|
[|] batch[|]Boolean[|] false[|]enables batch processing mode [|
|
||||||
[|]batch_size[|]Fixnum [|] nil[|]number of maximum items to be assigned at once[|[
|
[|]batch_size[|]Fixnum [|] nil[|]number of maximum items to be assigned at once[|
|
||||||
[|] logger[|]Logger [|] nil[|]logger instance for debug logs [|[
|
[|] logger[|]Logger [|] nil[|]logger instance for debug logs [|
|
||||||
|
|
||||||
Execute (g:easy_align_last_command should be set):
|
Execute (g:easy_align_last_command should be set):
|
||||||
Assert exists('g:easy_align_last_command')
|
Assert exists('g:easy_align_last_command')
|
||||||
|
|||||||
Reference in New Issue
Block a user