- Fixed for comment string.

This commit is contained in:
Shougo Matsushita 2012-11-05 12:01:14 +09:00
parent 59f7c05fb2
commit 177940ae3a
2 changed files with 13 additions and 11 deletions

View File

@ -1,7 +1,7 @@
"============================================================================= "=============================================================================
" FILE: neosnippet.vim " FILE: neosnippet.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com> " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 04 Nov 2012. " Last Modified: 05 Nov 2012.
" License: MIT license {{{ " License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining " Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the " 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\+$', '', '') let line = substitute(line, '\s\+$', '', '')
endif endif
if line =~ '^\s*#' if line =~ '^#'
" Comment. " Comment.
elseif line =~ '^include' elseif line =~ '^include'
" Include snippets. " Include snippets.
@ -373,19 +373,13 @@ function! s:parse_snippets_file(snippets, snippets_file)"{{{
let snippet_dict = s:parse_snippet_name( let snippet_dict = s:parse_snippet_name(
\ line, linenr, dup_check) \ line, linenr, dup_check)
elseif !empty(snippet_dict) elseif !empty(snippet_dict)
if line =~ '^\s' if line =~ '^\s' || line == ''
" Substitute one tab character or spaces.
if snippet_dict.word != '' if snippet_dict.word != ''
let snippet_dict.word .= "\n" let snippet_dict.word .= "\n"
else
" Substitute Tab character.
let line = substitute(line, '^\t', '', '')
endif endif
let snippet_dict.word .= let snippet_dict.word .=
\ matchstr(line, '^ *\zs.*$') \ substitute(line, '^\%(\t\| *\)', '', '')
elseif line =~ '^$'
" Blank line.
let snippet_dict.word .= "\n"
else else
call s:add_snippet_attribute(line, linenr, snippet_dict) call s:add_snippet_attribute(line, linenr, snippet_dict)
endif endif

View File

@ -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* UNITE SOURCES *neosnippet-unite-sources*
@ -683,6 +688,9 @@ A: Please try below settings. It defines snipMate function.
============================================================================== ==============================================================================
CHANGELOG *neosnippet-changelog* CHANGELOG *neosnippet-changelog*
2012-11-05
- Fixed for comment string.
2012-11-04 2012-11-04
- Improved completion behavior. - Improved completion behavior.