Consider space and CR expansions when jumping over. Closes #95.

This commit is contained in:
Israel Chauca Fuentes
2012-03-31 13:33:24 -04:00
parent 0b34aea202
commit 6bb98110b4
4 changed files with 76 additions and 8 deletions

View File

@@ -10,3 +10,11 @@ $(document).ready(function() {
x
})
--------------------------------------------------------------------------------
# Issue #95
new
exec "normal i(\<CR>test)x"
================================================================================
(
test
)x
--------------------------------------------------------------------------------

6
test/expand_space.txt Normal file
View File

@@ -0,0 +1,6 @@
# Issue #95
new
exec "normal i( test)x"
================================================================================
( test )x
--------------------------------------------------------------------------------

42
test/expand_space.vim Normal file
View File

@@ -0,0 +1,42 @@
let g:delimitMate_expand_space = 1
"DelimitMateReload
let lines = readfile(expand('<sfile>:t:r').'.txt')
call vimtest#StartTap()
let testsnumber = len(filter(copy(lines), 'v:val =~ ''^=\{80}$'''))
call vimtap#Plan(testsnumber)
let tcount = 1
let expect = 0
let evaluate = 0
for item in lines
if item =~ '^=\{80}$'
let expect = 1
let expected = []
continue
endif
if item =~ '^#\|^\s*$' && expect == 0
" A comment or empty line.
continue
endif
if ! expect
" A command.
exec item
call vimtap#Diag(item)
continue
endif
if item =~ '^-\{80}$'
let expect = 0
endif
if expect
call add(expected, item)
continue
endif
let lines = getline(1, line('$'))
let passed = lines == expected
echom string(lines)
echom string(expected)
call vimtap#Ok(passed, string(expected) .
\ (passed ? ' =' : ' !') . '= ' . string(lines))
let tcount += 1
endfor
call vimtest#Quit()