1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2026-02-21 10:35: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 endif
let word = matchstr(getline('.'), '\S\+\%'.col('.').'c') let word = matchstr(getline('.'), '\S\+\%'.col('.').'c')
for filetype in [bufnr('%')] + split(&ft, '\.') + ['_'] for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
let trigger = s:GetSnippet(word, filetype) let trigger = s:GetSnippet(word, scope)
if exists('s:snippet') | break | endif if exists('s:snippet') | break | endif
endfor endfor
@@ -556,8 +556,8 @@ fun s:UpdateSnip(...)
let i += 1 let i += 1
endif endif
call setline(pos[0], substitute(getline(pos[0]), '\%'.pos[1].'c'. call setline(pos[0], substitute(getline(pos[0]), '\%'.pos[1].'c\V'.
\ s:oldWord, newWord, '')) \ escape(s:oldWord, '\'), escape(newWord, '\'), ''))
endfor endfor
if oldStartSnip != s:startSnip if oldStartSnip != s:startSnip
call cursor('.', startCol + s:startSnip - oldStartSnip) call cursor('.', startCol + s:startSnip - oldStartSnip)