From 17ab5b07f021cb4e00a89c41dffb0afb781a0227 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 9 Nov 2012 12:39:41 +0900 Subject: [PATCH 1/2] - Improved convert description behavior. --- autoload/neosnippet.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index b350f78..fed90b7 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -410,10 +410,10 @@ function! s:parse_snippet_name(snippets_file, line, linenr, dup_check)"{{{ " Fall back to using the name and description (abbr) combined. " SnipMate snippets may have duplicate names, but different " descriptions (abbrs). - let description = matchstr(a:line, '^snippet\s\+\zs.*$') + let description = matchstr(a:line, '^snippet\s\+\S\+\zs.*$') if description !=# snippet_dict.name " Convert description. - let snippet_dict.name = + let snippet_dict.name .= '_' . \ substitute(description, '\W\+', '_', 'g') endif From bc1f26d74d3eb2cc548b805d945eff40db194b44 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 9 Nov 2012 14:25:32 +0900 Subject: [PATCH 2/2] - Fixed convert description. --- autoload/neosnippet.vim | 7 ++++--- doc/neosnippet.txt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index fed90b7..aa7e9cc 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -410,11 +410,12 @@ function! s:parse_snippet_name(snippets_file, line, linenr, dup_check)"{{{ " Fall back to using the name and description (abbr) combined. " SnipMate snippets may have duplicate names, but different " descriptions (abbrs). - let description = matchstr(a:line, '^snippet\s\+\S\+\zs.*$') - if description !=# snippet_dict.name + let description = matchstr(a:line, '^snippet\s\+\S\+\s\+\zs.*$') + if description != '' && description !=# snippet_dict.name " Convert description. let snippet_dict.name .= '_' . - \ substitute(description, '\W\+', '_', 'g') + \ substitute(substitute( + \ description, '\W\+', '_', 'g'), '_\+$', '', '') endif " Collect the description (abbr) of the snippet, if set on snippet line. diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 9011b50..3a36ed3 100755 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -716,6 +716,7 @@ CHANGELOG *neosnippet-changelog* - Improved syntax error. - Fixed error in java snippet. - Improved snippet rank. +- Fixed convert description. 2012-11-07 - Fixed s:indent_snippet().