From 5f32b8921e748640b93f9a11b31e4e164cf57a4b Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 4 Feb 2008 03:50:46 +0000 Subject: [PATCH] Don't back up if no match found --- plugin/surround.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index bb1ab83..4992a00 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -425,7 +425,9 @@ function! s:dosurround(...) " {{{1 else exe 'norm d'.strcount.'i'.char " One character backwards - call search('.','bW') + if getreg('"') != "" + call search('.','bW') + endif endif let keeper = getreg('"') let okeeper = keeper " for reindent below