-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbar.vim
55 lines (45 loc) · 1.27 KB
/
bar.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
runtime! plugin/arpeggio.vim
describe ':Arpeggio'
before
tabnew
end
after
tabclose!
end
it 'defines key mappings which contains <Bar> in their {lhs}'
let v:errmsg = ''
silent! execute 'Arpeggio nnoremap <buffer> }<Bar> Ifoo<Esc>'
Expect v:errmsg ==# ''
put ='xyz'
Expect getline('.') ==# 'xyz'
execute 'normal }|'
Expect getline('.') ==# 'fooxyz'
put ='zzy'
Expect getline('.') ==# 'zzy'
execute 'normal }|'
Expect getline('.') ==# 'foozzy'
normal! gg
Expect [line('.'), col('.'), getline('.')] ==# [1, 1, '']
execute 'normal }'
Expect [line('.'), col('.'), getline('.')] ==# [3, 6, 'foozzy']
execute 'normal 3|'
Expect [line('.'), col('.'), getline('.')] ==# [3, 3, 'foozzy']
end
it 'defines Insert mode key mappings with <Bar>'
let v:errmsg = ''
silent! execute 'Arpeggio inoremap <buffer> }<Bar> xyzzy'
Expect v:errmsg ==# ''
put ='abc'
Expect getline('.') ==# 'abc'
execute "normal i}|\<Esc>"
Expect getline('.') ==# 'xyzzyabc'
put ='def'
Expect getline('.') ==# 'def'
execute "normal i}\<Esc>"
Expect getline('.') ==# '}def'
put ='ghi'
Expect getline('.') ==# 'ghi'
execute "normal i|\<Esc>"
Expect getline('.') ==# '|ghi'
end
end