Skip to content

Commit

Permalink
fix neosnippet support
Browse files Browse the repository at this point in the history
Because NeoSnippetSource affects only current buffer,
snippets file is not loaded after the second time.
  • Loading branch information
choplin committed Apr 28, 2015
1 parent 8d42461 commit 512cb47
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ftplugin/go/snippets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ function! s:GoNeosnippet()
endif

let g:neosnippet#enable_snipmate_compatibility = 1
exec 'NeoSnippetSource' globpath(&rtp, 'gosnippets/snippets/go.snip')

let gosnippets_dir = globpath(&rtp, 'gosnippets/snippets')
if type(g:neosnippet#snippets_directory) == type([])
let g:neosnippet#snippets_directory += [gosnippets_dir]
elseif type(g:neosnippet#snippets_directory) == type("")
if strlen(g:neosnippet#snippets_directory) > 0
let g:neosnippet#snippets_directory = g:neosnippet#snippets_directory . "," . gosnippets_dir
else
let g:neosnippet#snippets_directory = gosnippets_dir
endif
endif
endfunction

if g:go_snippet_engine == "ultisnips"
Expand Down

0 comments on commit 512cb47

Please sign in to comment.