From 9265c5483ac717c340e42b717c0f5b5540dbe9e3 Mon Sep 17 00:00:00 2001 From: sasdf <> Date: Sun, 3 Jun 2018 18:53:52 +0800 Subject: [PATCH] Support ${VISUAL} keyword --- autoload/neosnippet.vim | 8 ++++---- autoload/neosnippet/view.vim | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index f51208e..ffed908 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -59,19 +59,19 @@ endfunction " Get marker patterns. function! neosnippet#get_placeholder_target_marker_pattern() abort - return '\%(\\\@' endfunction function! neosnippet#get_placeholder_marker_substitute_pattern() abort - return '\%(\\\@' diff --git a/autoload/neosnippet/view.vim b/autoload/neosnippet/view.vim index 297638b..73baf32 100644 --- a/autoload/neosnippet/view.vim +++ b/autoload/neosnippet/view.vim @@ -336,6 +336,7 @@ function! s:expand_placeholder(start, end, holder_cnt, line, ...) abort " Remove optional marker let default = substitute(default, '^#:', '', '') + let default = substitute(default, '\${VISUAL\(:.\{-}\)\?}', 'TARGET\1', '') let is_target = (default =~ '^TARGET\>' && neosnippet.target != '') let default = substitute(default, '^TARGET:\?', neosnippet.target, '')