Skip to content

Commit

Permalink
Allow newlines in closing (but not opening) of replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Oct 31, 2006
1 parent f97446a commit d12310f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugin/surround.vim
Expand Up @@ -383,7 +383,7 @@ function! s:wrap(string,char,type,...)
let before = before . "\n\t"
endif
if type ==# "v"
let after = "\n" . initspaces . after
let after = "\n". after
endif
endif
endif
Expand Down Expand Up @@ -422,6 +422,8 @@ function! s:wrap(string,char,type,...)
let before = newchar
let after = newchar
endif
"let before = substitute(before,'\n','\n'.initspaces,'g')
let after = substitute(after ,'\n','\n'.initspaces,'g')
if type ==# 'V' || (special && type ==# "v")
let before = substitute(before,' \+$','','')
let after = substitute(after ,'^ \+','','')
Expand Down Expand Up @@ -503,6 +505,7 @@ function! s:insert(...) " {{{1
endif
call search('\r','bW')
return "\<Del>"
" Old implementation follows
let @@ = reg_save
"let text = s:wrap("\r",char,0)
"call inputrestore()
Expand Down

0 comments on commit d12310f

Please sign in to comment.