Better handling of insert_eol_marker. Should fix #195.

This commit is contained in:
Israel Chauca Fuentes
2015-01-17 14:03:48 -05:00
parent 254a89d67c
commit 470c053a3b
2 changed files with 25 additions and 9 deletions

View File

@@ -474,8 +474,10 @@ function! delimitMate#ExpandReturn() "{{{
\ || expand_inside_quotes)
let val = "\<Esc>a"
if is_empty_matchpair && s:get('insert_eol_marker') == 2
let repeat = search('\s\%#\s', 'bcnW', '.') ? 2 : 1
let val .= repeat("\<Right>", repeat) . s:get('eol_marker') . repeat("\<Left>", repeat + 1)
\ && !search(escape(s:get('eol_marker'), '[]\.*^$').'$', 'cnW', '.')
let tail = getline('.')[col('.') - 1 : ]
let times = len(split(tail, '\zs'))
let val .= repeat("\<Right>", times) . s:get('eol_marker') . repeat("\<Left>", times + 1)
endif
let val .= "\<CR>"
if &smartindent && !&cindent && !&indentexpr