Fix :NeoSnippetClearMarkers behavior

This commit is contained in:
Shougo Matsushita 2014-01-20 00:13:18 +09:00
parent 103d701267
commit cf1211c242
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: commands.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 01 Jan 2014.
" Last Modified: 20 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@ -158,6 +158,7 @@ function! neosnippet#commands#_clear_markers() "{{{
try
while neosnippet#view#_search_snippet_range(
\ begin, end, expand_info.holder_cnt, 0)
" Next count.
let expand_info.holder_cnt += 1
let found = 1

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: view.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 25 Dec 2013.
" Last Modified: 20 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@ -298,6 +298,10 @@ function! s:expand_placeholder(start, end, holder_cnt, line, ...) "{{{
let default = substitute(
\ matchstr(current_line, default_pattern),
\ '\\\ze[^\\]', '', 'g')
if !is_select && default =~ '^#:'
" Delete comments.
let default = ''
endif
let is_target = (default =~ '^TARGET\>' && neosnippet.target != '')
let default = substitute(default, '^TARGET:\?', neosnippet.target, '')