- Changed spaces behavior.

This commit is contained in:
Shougo Matsushita 2012-11-05 16:59:39 +09:00
parent 83c199831c
commit 0a2d19aea4
2 changed files with 9 additions and 12 deletions

View File

@ -189,7 +189,7 @@ function! s:set_snippet_dict(snippet_dict, snippets, dup_check, snippets_file)"{
endfor endfor
endfunction"}}} endfunction"}}}
function! s:initialize_snippet(dict, path, line, pattern, name)"{{{ function! s:initialize_snippet(dict, path, line, pattern, name)"{{{
let a:dict.word = substitute(a:dict.word, '\n$', '', '') let a:dict.word = substitute(a:dict.word, '\n\+$', '', '')
if a:dict.word !~ if a:dict.word !~
\ s:get_placeholder_marker_substitute_pattern() \ s:get_placeholder_marker_substitute_pattern()
" Add placeholder. " Add placeholder.
@ -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 =~ '^#' || line == '' if line =~ '^#'
" Ignore. " Ignore.
elseif line =~ '^include' elseif line =~ '^include'
" Include snippets. " Include snippets.
@ -373,11 +373,7 @@ 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 != ''
" let snippet_dict.word .= "\n"
" endif
let snippet_dict.word .= let snippet_dict.word .=
\ substitute(line, '^\%(\t\| *\)', '', '') . "\n" \ substitute(line, '^\%(\t\| *\)', '', '') . "\n"
else else

View File

@ -628,8 +628,8 @@ Note: "#{string}" is comment string. But it must be in head.
# It is not comment string! # It is not comment string!
< <
Note: Neosnippet ignores empty line in snippet. If you want to insert empty Note: Neosnippet ignores empty or spaces lines in snippet end. If you want to insert empty
line in the snippet, you must insert speces or tabs. line in snippet end, you must insert placeholder.
> >
# This is valid. # This is valid.
snippet #! snippet #!
@ -640,14 +640,14 @@ line in the snippet, you must insert speces or tabs.
${0} ${0}
# This is invalid(no spaces!). # This is invalid(ignores spaces lines!).
snippet #! snippet #!
abbr #!/usr/bin/env ruby abbr #!/usr/bin/env ruby
alias shebang alias shebang
options head options head
#!/usr/bin/env ruby #!/usr/bin/env ruby
${0}
< <
============================================================================== ==============================================================================
@ -715,6 +715,7 @@ CHANGELOG *neosnippet-changelog*
- Fixed for comment string. - Fixed for comment string.
- Fixed snippet parser. - Fixed snippet parser.
- Improved syntax description. - Improved syntax description.
- Changed spaces behavior.
2012-11-04 2012-11-04
- Improved completion behavior. - Improved completion behavior.