- Supported context_filetype.

This commit is contained in:
Shougo Matsushita 2013-05-28 19:22:54 +09:00
parent 92a53f748e
commit abd51a57da
2 changed files with 19 additions and 3 deletions

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: neosnippet.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 21 May 2013.
" Last Modified: 28 May 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@ -45,6 +45,15 @@ let s:neosnippet_options = [
\ '-runtime',
\ '-vertical', '-horizontal', '-direction=', '-split',
\]
" context_filetype.vim installation check.
if !exists('s:exists_context_filetype')
try
call context_filetype#version()
let s:exists_context_filetype = 1
catch
let s:exists_context_filetype = 0
endtry
endif
"}}}
function! neosnippet#initialize() "{{{
@ -1042,8 +1051,8 @@ function! neosnippet#get_runtime_snippets_directory() "{{{
return copy(s:runtime_dir)
endfunction"}}}
function! neosnippet#get_filetype() "{{{
return exists('*neocomplcache#get_context_filetype') ?
\ neocomplcache#get_context_filetype(1) :
return s:exists_context_filetype ?
\ context_filetype#get_filetype() :
\ (&filetype == '' ? 'nothing' : &filetype)
endfunction"}}}
function! s:get_sources_filetypes(filetype) "{{{

View File

@ -59,6 +59,10 @@ Note: neocomplcache is NOT required! But recommended.
Extra snippets files are available in:
https://github.com/honza/vim-snippets
Note: To enable context filetype feature, you must install
context_filetype.vim.
https://github.com/Shougo/context_filetype.vim
==============================================================================
INTERFACE *neosnippet-interface*
@ -784,6 +788,9 @@ A: You can use |:NeoSnippetSource| for it.
==============================================================================
CHANGELOG *neosnippet-changelog*
2013-05-28
- Supported context_filetype.
2013-05-27
- Added clojure snippets.