From 6eef3d5462b8ded58c1a5d7a35608ac30a8b3a99 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Thu, 4 Oct 2012 12:35:07 +0900 Subject: [PATCH] - Changed :NeoSnippetEdit behavior. --- autoload/neosnippet.vim | 13 +++++++++++-- doc/neosnippet.txt | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 099b34b..804cb92 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -241,8 +241,17 @@ function! neosnippet#edit_snippets(args)"{{{ endif " Edit snippet file. - let filename = (options.runtime ? s:runtime_dir[0] : s:snippets_dir[-1]) - \ .'/'.filetype.'.snip' + let snippet_dir = (options.runtime ? s:runtime_dir[0] : s:snippets_dir[-1]) + let filename = snippet_dir .'/'.filetype + + if isdirectory(filename) + " Edit in snippet directory. + let filename .= '/'.filetype + endif + + if filename !~ '\.snip*$' + let filename .= '.snip' + endif if options.split " Split window. diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index f8b8757..637922b 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -70,6 +70,9 @@ COMMANDS *neosnippet-commands* *:NeoSnippetEdit* Opens [filetype] snippets to edit. It automatically selects current buffer's filetype unless you specify [filetype]. + + If [filetype] snippets has a directory, it automatically edit + "[filetype].snip" in [filetype] subdirectory. If [filetype] snippet file doesn't exist, it creates one automatically. @@ -391,6 +394,7 @@ CHANGELOG *neosnippet-changelog* 2012-10-04 - Refactored snippets filter. +- Changed :NeoSnippetEdit behavior. 2012-10-01 - Deleted neosnippet#force_expandable().