From 5cc6e56248f399114fd7f6f0f9996e8e813e9e71 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 1 Oct 2007 15:27:33 +0000 Subject: [PATCH] Fixed multiline surrounds in insert mode --- plugin/surround.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index eea13fa..a3bc81d 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -357,7 +357,7 @@ function! s:insert(...) " {{{1 " remove the initial newline. This fits a use case of mine but is a " little inconsistent. Is there anyone that would prefer the simpler " behavior of just inserting the newline? - if linemode && matchstr(getreg('"'),'^\n\s*\zs.*') == 0 + if linemode && match(getreg('"'),'^\n\s*\zs.*') == 0 call setreg('"',matchstr(getreg('"'),'^\n\s*\zs.*'),getregtype('"')) endif " This can be used to append a placeholder to the end