From 4d3bc928e01bc741232d587709247c3af6791a81 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 22 Nov 2013 12:21:35 +0900 Subject: [PATCH] Fix #192 target behavior --- autoload/neosnippet/view.vim | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/autoload/neosnippet/view.vim b/autoload/neosnippet/view.vim index 2ae387b..d955905 100644 --- a/autoload/neosnippet/view.vim +++ b/autoload/neosnippet/view.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: view.vim " AUTHOR: Shougo Matsushita -" Last Modified: 21 Nov 2013. +" Last Modified: 22 Nov 2013. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -344,14 +344,8 @@ function! s:expand_placeholder(start, end, holder_cnt, line, ...) "{{{ \ matchstr(current_line, default_pattern), \ '\\\ze[^\\]', '', 'g') - if default =~ '^TARGET\>' && neosnippet.target != '' - let default = '' - let is_target = 1 - else - let is_target = 0 - endif - - let default = substitute(default, '^TARGET:\?', '', '') + let is_target = (default =~ '^TARGET\>' && neosnippet.target != '') + let default = substitute(default, '^TARGET:\?', neosnippet.target, '') let neosnippet.selected_text = default @@ -385,7 +379,7 @@ function! s:expand_placeholder(start, end, holder_cnt, line, ...) "{{{ call setpos('.', pos) - if is_target + if is_target && cnt < 0 " Expand target return s:expand_target_placeholder(a:line, match+1) endif