Add expand_cr

This commit is contained in:
Israel Chauca Fuentes
2017-02-11 11:11:17 -05:00
parent b6cc751cc9
commit 7809c5e171
2 changed files with 59 additions and 22 deletions

View File

@@ -14,27 +14,25 @@ call vimtest#StartTap()
call vimtap#Plan(25)
let g:delimitMate_expand_cr = 1
DelimitMateReload
"let g:delimitMate_eol_marker = ';'
filetype indent on
set bs=2 et sts=4 sw=4 ft=javascript
call DMTest_single('$(document).ready(function() {})',
\ "\<Esc>31|i\<CR>x\<Esc>",
\ "31|i\<CR>x",
\ ["$(document).ready(function() {", " x", "})"])
" Issue #95
new
let b:delimitMate_jump_expansion = 1
DelimitMateReload
call DMTest_single('', "(\<CR>test)x",
call DMTest_single('', "i(\<CR>test)x",
\ ['(', 'test', ')x'])
" Remove CR expansion on BS
call DMTest_single('', "(\<CR>\<BS>x",
call DMTest_single('', "i(\<CR>\<BS>x",
\ ['(x)'])
" Consider indentation with BS inside an empty CR expansion.
call DMTest_single('', "( \<CR>\<BS>\<BS>x", '(x)')
call DMTest_single('', "i( \<CR>\<BS>\<BS>x", '(x)')
" Conflict with indentation settings (cindent). Issue #95
se cindent
@@ -44,7 +42,7 @@ call DMTest_single(
\ ' ',
\ ' }',
\ '}'],
\ "\<Esc>3G8|a}x",
\ "i\<Esc>3G8|a}x",
\ ['sub foo {',
\ ' while (1) {',
\ ' ',
@@ -62,33 +60,31 @@ set foldmethod=marker
set foldmarker={,}
set foldlevel=0
set backspace=2
call DMTest_single('', "abc {\<CR>x",
call DMTest_single('', "iabc {\<CR>x",
\['abc {',
\ ' x',
\ '}'])
" expand_cr != 2
call DMTest_single('abc(def)', "\<Esc>$i\<CR>x",
call DMTest_single('abc(def)', "i\<Esc>$i\<CR>x",
\ ['abc(def',
\ ' x)'])
" expand_cr == 2
let delimitMate_expand_cr = 2
DelimitMateReload
call DMTest_single('abc(def)', "\<Esc>$i\<CR>x", ['abc(def', ' x', ' )'])
call DMTest_single('abc(def)', "i\<Esc>$i\<CR>x", ['abc(def', ' x', ' )'])
" Play nice with smartindent
set all&
set smartindent
call DMTest_single('', "\<Esc>$i{\<CR>x", ['{', ' x', '}'])
call DMTest_single('', "i\<Esc>$i{\<CR>x", ['{', ' x', '}'])
call DMTest_quotes('', "' x", "' x'")
call DMTest_quotes('', "i' x", "' x'")
call DMTest_quotes('', "'\<CR>x", ["'", "x'"])
call DMTest_quotes('', "i'\<CR>x", ["'", "x'"])
let delimitMate_expand_inside_quotes = 1
DelimitMateReload
call DMTest_quotes('', "'\<CR>x", ["'", "x", "'"])
call DMTest_quotes('', "i'\<CR>x", ["'", "x", "'"])
call vimtest#Quit()