1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2025-12-19 20:38:05 +01:00

fixed arguments for GetSnippet()

This commit is contained in:
Michael Sanders
2009-03-19 19:15:24 -04:00
parent 4a63cf2adc
commit b905e94673

View File

@@ -145,13 +145,13 @@ endf
" Check if word under cursor is snippet trigger; if it isn't, try checking if
" the text after non-word characters is (e.g. check for "foo" in "bar.foo")
fun s:GetSnippet(scope, ft)
let word = a:scope
fun s:GetSnippet(word, scope)
let word = a:word
wh !exists('s:snippet')
if exists('s:snippets["'.a:ft.'"]["'.word.'"]')
let s:snippet = s:snippets[a:ft][word]
elseif exists('s:multi_snips["'.a:ft.'"]["'.word.'"]')
let s:snippet = s:ChooseSnippet(a:ft, word)
if exists('s:snippets["'.a:scope.'"]["'.word.'"]')
let s:snippet = s:snippets[a:scope][word]
elseif exists('s:multi_snips["'.a:scope.'"]["'.word.'"]')
let s:snippet = s:ChooseSnippet(a:scope, word)
else
if match(word, '\W') == -1 | break | endif
let word = substitute(word, '.\{-}\W', '', '')