From 0a2d19aea4fb119eb95898f32678e4df153c45ec Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Mon, 5 Nov 2012 16:59:39 +0900 Subject: [PATCH] - Changed spaces behavior. --- autoload/neosnippet.vim | 10 +++------- doc/neosnippet.txt | 11 ++++++----- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 3c374f9..9ce8b20 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -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 diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 2b836b4..bf8eae2 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -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.