mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-10 10:53:49 -05:00
123 lines
1.8 KiB
Plaintext
123 lines
1.8 KiB
Plaintext
Execute:
|
|
Save &tabstop
|
|
|
|
Given (Table):
|
|
|a|b|c|d|
|
|
| -|-|>-|-|
|
|
|aaa|bbb|ccc|ddd|
|
|
|
|
Do (Partial alignment around 1st |):
|
|
\<C-V>ljj\<Enter>|
|
|
|
|
Expect (Right margin should be correctly attached):
|
|
| a|b|c|d|
|
|
| -|-|>-|-|
|
|
| aaa|bbb|ccc|ddd|
|
|
|
|
Given (empty buffer):
|
|
|
|
Execute (Aligning lines with many delimiters should not fail):
|
|
call visualmode(1)
|
|
call setline(1, repeat('|', &maxfuncdepth + 1))
|
|
%EasyAlign*|
|
|
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<|
|
|
|
|
Given (Tab-indented code (#20)):
|
|
class MyUnitTest(unittest.TestCase):
|
|
def test_base(self):
|
|
n2f = {}
|
|
n2v = {}
|
|
f2v = {}
|
|
n2gv = {}
|
|
n2vt = {}
|
|
|
|
Execute:
|
|
set tabstop=1
|
|
%EasyAlign=
|
|
|
|
Expect:
|
|
class MyUnitTest(unittest.TestCase):
|
|
def test_base(self):
|
|
n2f = {}
|
|
n2v = {}
|
|
f2v = {}
|
|
n2gv = {}
|
|
n2vt = {}
|
|
|
|
Execute:
|
|
set tabstop=2
|
|
%EasyAlign=
|
|
|
|
Expect:
|
|
class MyUnitTest(unittest.TestCase):
|
|
def test_base(self):
|
|
n2f = {}
|
|
n2v = {}
|
|
f2v = {}
|
|
n2gv = {}
|
|
n2vt = {}
|
|
|
|
Execute:
|
|
set tabstop=4
|
|
%EasyAlign=
|
|
|
|
Expect:
|
|
class MyUnitTest(unittest.TestCase):
|
|
def test_base(self):
|
|
n2f = {}
|
|
n2v = {}
|
|
f2v = {}
|
|
n2gv = {}
|
|
n2vt = {}
|
|
|
|
Execute:
|
|
set tabstop=8
|
|
%EasyAlign=
|
|
|
|
Expect:
|
|
class MyUnitTest(unittest.TestCase):
|
|
def test_base(self):
|
|
n2f = {}
|
|
n2v = {}
|
|
f2v = {}
|
|
n2gv = {}
|
|
n2vt = {}
|
|
|
|
Execute:
|
|
set tabstop=12
|
|
%EasyAlign=
|
|
|
|
Expect:
|
|
class MyUnitTest(unittest.TestCase):
|
|
def test_base(self):
|
|
n2f = {}
|
|
n2v = {}
|
|
f2v = {}
|
|
n2gv = {}
|
|
n2vt = {}
|
|
|
|
Execute:
|
|
Restore
|