From e49d6c2459e0f5569ff2d533b4df995dd7f98313 Mon Sep 17 00:00:00 2001 From: Adriaan Zonnenberg Date: Thu, 2 Jun 2016 00:06:04 +0200 Subject: [PATCH] Only add colon if prompt ends with word (#204) Lets you use your own ending characters, instead of always adding ': '. Closes #203 --- plugin/surround.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index 6a986e8..46f3252 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -92,7 +92,7 @@ function! s:process(string) let m = matchstr(a:string,nr2char(i).'.\{-\}\ze'.nr2char(i)) if m != '' let m = substitute(strpart(m,1),'\r.*','','') - let repl_{i} = input(substitute(m,':\s*$','','').': ') + let repl_{i} = input(match(m,'\w\+$') >= 0 ? m.': ' : m) endif endfor let s = ""