- 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
endfunction"}}}
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 !~
\ s:get_placeholder_marker_substitute_pattern()
" Add placeholder.
@ -347,7 +347,7 @@ function! s:parse_snippets_file(snippets, snippets_file)"{{{
let line = substitute(line, '\s\+$', '', '')
endif
if line =~ '^#' || line == ''
if line =~ '^#'
" Ignore.
elseif line =~ '^include'
" Include snippets.
@ -373,11 +373,7 @@ 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'
" Substitute one tab character or spaces.
" if snippet_dict.word != ''
" let snippet_dict.word .= "\n"
" endif
if line =~ '^\s' || line == ''
let snippet_dict.word .=
\ substitute(line, '^\%(\t\| *\)', '', '') . "\n"
else

View File

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