1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2026-02-17 05:55:45 +01:00

fixed bug with special characters in placeholders

This commit is contained in:
Michael Sanders
2009-03-22 19:35:50 -04:00
parent a3e3958d30
commit bf7cfb1d1f

View File

@@ -118,8 +118,8 @@ fun! TriggerSnippet()
endif
let word = matchstr(getline('.'), '\S\+\%'.col('.').'c')
for filetype in [bufnr('%')] + split(&ft, '\.') + ['_']
let trigger = s:GetSnippet(word, filetype)
for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
let trigger = s:GetSnippet(word, scope)
if exists('s:snippet') | break | endif
endfor
@@ -556,8 +556,8 @@ fun s:UpdateSnip(...)
let i += 1
endif
call setline(pos[0], substitute(getline(pos[0]), '\%'.pos[1].'c'.
\ s:oldWord, newWord, ''))
call setline(pos[0], substitute(getline(pos[0]), '\%'.pos[1].'c\V'.
\ escape(s:oldWord, '\'), escape(newWord, '\'), ''))
endfor
if oldStartSnip != s:startSnip
call cursor('.', startCol + s:startSnip - oldStartSnip)