Only add colon if prompt ends with word (#204)

Lets you use your own ending characters, instead of always adding ': '.

Closes #203
This commit is contained in:
Adriaan Zonnenberg 2016-06-02 00:06:04 +02:00 committed by Tim Pope
parent 2d05440ad2
commit e49d6c2459

View File

@ -92,7 +92,7 @@ function! s:process(string)
let m = matchstr(a:string,nr2char(i).'.\{-\}\ze'.nr2char(i)) let m = matchstr(a:string,nr2char(i).'.\{-\}\ze'.nr2char(i))
if m != '' if m != ''
let m = substitute(strpart(m,1),'\r.*','','') 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 endif
endfor endfor
let s = "" let s = ""