More flexible test for 'backspace' values.

This commit is contained in:
Israel Chauca Fuentes
2010-11-06 22:38:13 -05:00
parent 2ba694830d
commit ff4745b191
2 changed files with 4 additions and 4 deletions

View File

@@ -182,7 +182,8 @@ Values: 1 or 0 ~
Default: 0 ~
This option turns on/off the expansion of <CR>. Read |delimitMateExpansion|
for details.
for details. NOTE This feature requires that 'backspace' is either set to 2 or
has "eol" and "start" as part of its value.
e.g.: >
let delimitMate_expand_cr = 1
au FileType mail let b:delimitMate_expand_cr = 1

View File

@@ -104,11 +104,10 @@ function! s:init() "{{{
unlet g:delimitMate_expand_cr
let g:delimitMate_expand_cr = 1
endif
if (&backspace !~ 'eol' || &backspace !~ 'start') &&
if ((&backspace !~ 'eol' || &backspace !~ 'start') && &backspace != 2) &&
\ ((exists('b:delimitMate_expand_cr') && b:delimitMate_expand_cr == 1) ||
\ (exists('g:delimitMate_expand_cr') && g:delimitMate_expand_cr == 1))
echom "delimitMate: In order to use the <CR> expansion, you need to have 'eol' and 'start' in your backspace option. Read :help 'backspace'."
let b:delimitMate_expand_cr = 0
echom "delimitMate: There seems to be some incompatibility with your settings that may interfer with the expansion of <CR>. See :help 'delimitMate_expand_cr' for details."
endif
call s:option_init("expand_cr", 0)