Fix CR expansion & syn fold enabled by InsertLeave

Benamin Fritz reported the following:

Without the "zv", if the user has syntax folding on, when the mapping
invokes <Esc> the pair of braces which were just separated by a <CR>
could become folded, so that the trailing "o" opens a new line AFTER
the pair.
This commit is contained in:
Israel Chauca Fuentes
2012-06-08 16:51:28 -04:00
parent 9c1564a22f
commit 1dfe26a538
2 changed files with 19 additions and 2 deletions

View File

@@ -418,7 +418,9 @@ function! delimitMate#ExpandReturn() "{{{
" Not sure why I used the previous combos, but I'm sure somebody will tell
" me about it.
return "\<Esc>a\<CR>\<Esc>O"
" XXX zv prevents breaking expansion with syntax folding enabled by
" InsertLeave.
return "\<Esc>a\<CR>\<Esc>zvO"
else
return "\<CR>"
endif