From abd51a57da2f0da948a51a753b595ff7a8b80834 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Tue, 28 May 2013 19:22:54 +0900 Subject: [PATCH] - Supported context_filetype. --- autoload/neosnippet.vim | 15 ++++++++++++--- doc/neosnippet.txt | 7 +++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 37ae301..d9c3e84 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" 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) "{{{ diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 3e126d1..bffd4fc 100755 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -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.