- 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
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 23 Sep 2012.
" Last Modified: 27 Sep 2012.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" 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)
let a:dict.word = substitute(a:dict.word, '\n$', '', '')
let menu_pattern =
\ (a:dict.word =~ '\${\d\+\%(:.\{-}\)\?\\\@<!}') ?
let menu_pattern = (a:dict.word =~
\ s:get_placeholder_marker_substitute_pattern()) ?
\ '<Snip> ' : '[Snip] '
let abbr = get(a:dict, 'abbr', substitute(a:dict.word,
@ -459,7 +459,8 @@ function! s:load_snippets(snippet, snippets_file)"{{{
let linenr += 1
endfor
if snippet_pattern.word !~ '\\\@<!${0}'
if snippet_pattern.word !~
\ s:get_placeholder_marker_substitute_pattern()
" Add placeholder.
let snippet_pattern.word .= '${0}'
endif

View File

@ -306,6 +306,9 @@ snippet *neocomplcache-snippets-complete-unite-action-snippet*
==============================================================================
CHANGELOG *neocomplcache-snippets-complete-changelog*
2012-09-27
- Improved add placeholder behavior.
2012-09-23
- Fixed substitute tab character.
- Improved cursor position.