From bbf1f43ec547b0c4f6ea7e66395abbf05dc6d7c1 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Mon, 5 Nov 2012 12:11:25 +0900 Subject: [PATCH] - Fixed snippet parser. --- autoload/neosnippet.vim | 14 +++++++------- doc/neosnippet.txt | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 1b1704b..3c374f9 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -347,8 +347,8 @@ function! s:parse_snippets_file(snippets, snippets_file)"{{{ let line = substitute(line, '\s\+$', '', '') endif - if line =~ '^#' - " Comment. + if line =~ '^#' || line == '' + " Ignore. elseif line =~ '^include' " Include snippets. let filename = matchstr(line, '^include\s\+\zs.*$') @@ -373,13 +373,13 @@ function! s:parse_snippets_file(snippets, snippets_file)"{{{ let snippet_dict = s:parse_snippet_name( \ line, linenr, dup_check) elseif !empty(snippet_dict) - if line =~ '^\s' || line == '' + if line =~ '^\s' " Substitute one tab character or spaces. - if snippet_dict.word != '' - let snippet_dict.word .= "\n" - endif + " if snippet_dict.word != '' + " let snippet_dict.word .= "\n" + " endif let snippet_dict.word .= - \ substitute(line, '^\%(\t\| *\)', '', '') + \ substitute(line, '^\%(\t\| *\)', '', '') . "\n" else call s:add_snippet_attribute(line, linenr, snippet_dict) endif diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index d1eb13a..b14606c 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -690,6 +690,7 @@ CHANGELOG *neosnippet-changelog* 2012-11-05 - Fixed for comment string. +- Fixed snippet parser. 2012-11-04 - Improved completion behavior.