- Merged.

This commit is contained in:
Christian Höltje 2012-10-28 01:25:52 -04:00 committed by Shougo Matsushita
parent 2fde49493b
commit d305dde1cc
2 changed files with 20 additions and 1 deletions

View File

@ -344,8 +344,18 @@ function! s:load_snippets(snippet, snippets_file)"{{{
\ 'options' : { 'head' : 0, 'word' : 0 } }
endif
" Try using the name without the description (abbr).
let snippet_pattern.name = matchstr(line, '^snippet\s\+\zs\S\+')
" Fall back to using the name and description (abbr) combined.
" SnipMate snippets may have duplicate names, but different
" descriptions (abbrs).
if has_key(dup_check, snippet_pattern.name)
let snippet_pattern.name =
\ substitute(matchstr(line, '^snippet\s\+\zs.*$'),
\ '\s\+', '_', 'g')
endif
" Collect the description (abbr) of the snippet, if set on snippet line.
" This is for compatibility with SnipMate-style snippets.
let snippet_pattern.abbr = matchstr(line, '^snippet\s\+\S\+\s\+\zs.*$')

View File

@ -10,8 +10,17 @@ abbr def end
${2}
end
snippet defrescue
alias defr
abbr def ... rescue ... end
def ${1:method_name}
${2}
rescue ${3:StandardError} => ${4:error}
${5}
end
snippet do
abbr do end
abbr do ... end
do
${1}
end