From 177940ae3abb2d5c810af8304c6fc83cd53bdb4b Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Mon, 5 Nov 2012 12:01:14 +0900 Subject: [PATCH] - Fixed for comment string. --- autoload/neosnippet.vim | 16 +++++----------- doc/neosnippet.txt | 8 ++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index a20de4e..1b1704b 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 04 Nov 2012. +" Last Modified: 05 Nov 2012. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -347,7 +347,7 @@ function! s:parse_snippets_file(snippets, snippets_file)"{{{ let line = substitute(line, '\s\+$', '', '') endif - if line =~ '^\s*#' + if line =~ '^#' " Comment. elseif line =~ '^include' " Include snippets. @@ -373,19 +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' + if line =~ '^\s' || line == '' + " Substitute one tab character or spaces. if snippet_dict.word != '' let snippet_dict.word .= "\n" - else - " Substitute Tab character. - let line = substitute(line, '^\t', '', '') endif - let snippet_dict.word .= - \ matchstr(line, '^ *\zs.*$') - elseif line =~ '^$' - " Blank line. - let snippet_dict.word .= "\n" + \ substitute(line, '^\%(\t\| *\)', '', '') else call s:add_snippet_attribute(line, linenr, snippet_dict) endif diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 41f7ac7..d1eb13a 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -622,6 +622,11 @@ languages' indent files can not work very well (e.g.: PHP, Python). } < +Note: "#{string}" is comment string. But it must be in head. +> + # It is comment string + # It is not comment string! +< ============================================================================== UNITE SOURCES *neosnippet-unite-sources* @@ -683,6 +688,9 @@ A: Please try below settings. It defines snipMate function. ============================================================================== CHANGELOG *neosnippet-changelog* +2012-11-05 +- Fixed for comment string. + 2012-11-04 - Improved completion behavior.