/
expand_cr.txt
65 lines (64 loc) · 2.11 KB
/
expand_cr.txt
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
56
57
58
59
60
61
62
63
64
65
#
%d
filetype indent on
set bs=2 et sts=4 sw=4 ft=javascript
call setline(1, '$(document).ready(function() {})')
DelimitMateReload
exec "normal 31|i\<CR>x\<Esc>"
================================================================================
$(document).ready(function() {
x
})
--------------------------------------------------------------------------------
# Issue #95
new
exec "normal i(\<CR>test)x"
================================================================================
(
test
)x
--------------------------------------------------------------------------------
# Remove CR expansion on BS
%d
exec "normal i(\<CR>\<BS>x"
================================================================================
(x)
--------------------------------------------------------------------------------
# Consider indentation with BS inside an empty CR expansion.
%d
exec "normal i( \<CR>\<BS>\<BS>x"
================================================================================
(x)
--------------------------------------------------------------------------------
# Conflict with indentation settings (cindent). Issue #95
se cindent
call setline(1, ['sub foo {',' while (1) {', ' ', ' }', '}'])
call cursor(3, 8)
normal a}x
================================================================================
sub foo {
while (1) {
}x
}
--------------------------------------------------------------------------------
%d
call setline(1, "\"{bracketed}")
normal A"x
================================================================================
"{bracketed""x
--------------------------------------------------------------------------------
# Syntax folding enabled by autocmd breaks expansion. But ti can't be tested
# with :normal
new
autocmd InsertEnter * let w:fdm=&foldmethod | setl foldmethod=manual
autocmd InsertLeave * let &foldmethod = w:fdm
set foldmethod=marker
set foldmarker={,}
set foldlevel=0
set backspace=2
exec "normal iabc {\<CR>x"
================================================================================
abc {
x
}
--------------------------------------------------------------------------------