- Improved add placeholder behavior.

This commit is contained in:
Shougo Matsushita 2012-09-27 07:38:16 +09:00
parent c0503b0f00
commit 9bfd793dfa
2 changed files with 9 additions and 5 deletions

View File

@ -1,7 +1,7 @@
"============================================================================= "=============================================================================
" FILE: snippets_complete.vim " FILE: snippets_complete.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com> " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 23 Sep 2012. " Last Modified: 27 Sep 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
@ -309,8 +309,8 @@ function! s:set_snippet_pattern(dict)"{{{
\ g:neocomplcache_max_keyword_width-10) \ g:neocomplcache_max_keyword_width-10)
let a:dict.word = substitute(a:dict.word, '\n$', '', '') let a:dict.word = substitute(a:dict.word, '\n$', '', '')
let menu_pattern = let menu_pattern = (a:dict.word =~
\ (a:dict.word =~ '\${\d\+\%(:.\{-}\)\?\\\@<!}') ? \ s:get_placeholder_marker_substitute_pattern()) ?
\ '<Snip> ' : '[Snip] ' \ '<Snip> ' : '[Snip] '
let abbr = get(a:dict, 'abbr', substitute(a:dict.word, let abbr = get(a:dict, 'abbr', substitute(a:dict.word,
@ -459,7 +459,8 @@ function! s:load_snippets(snippet, snippets_file)"{{{
let linenr += 1 let linenr += 1
endfor endfor
if snippet_pattern.word !~ '\\\@<!${0}' if snippet_pattern.word !~
\ s:get_placeholder_marker_substitute_pattern()
" Add placeholder. " Add placeholder.
let snippet_pattern.word .= '${0}' let snippet_pattern.word .= '${0}'
endif endif

View File

@ -304,7 +304,10 @@ snippet *neocomplcache-snippets-complete-unite-action-snippet*
preview View snippet definition preview View snippet definition
============================================================================== ==============================================================================
CHANGELOG *neocomplcache-snippets-complete-changelog* CHANGELOG *neocomplcache-snippets-complete-changelog*
2012-09-27
- Improved add placeholder behavior.
2012-09-23 2012-09-23
- Fixed substitute tab character. - Fixed substitute tab character.