diff options
-rw-r--r-- | autoload/sonictemplate.vim | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index 9397efa..a7476f8 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -1,7 +1,7 @@ "============================================================================= " sonictemplate.vim " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> -" Last Change: 07-Mar-2019. +" Last Change: 04-Jun-2019. let s:save_cpo = &cpo set cpo&vim @@ -320,15 +320,9 @@ function! sonictemplate#apply(name, mode, ...) abort endif endif if stridx(c, '{{_cursor_}}') != -1 - if a:mode == 'n' - silent! call search('\zs{{_cursor_}}', 'w') - silent! foldopen - silent! normal! 12"_x - else - silent! call search('{{_cursor_}}\zs', 'w') - silent! foldopen - silent! call feedkeys(repeat("\<bs>", 12)) - endif + silent! call search('\zs{{_cursor_}}', 'w') + silent! foldopen + silent! normal! "_da} endif endfunction @@ -377,9 +371,9 @@ function! sonictemplate#postfix() let &indentexpr = oldindentexpr endif if stridx(c, '{{_cursor_}}') != -1 - silent! call search('{{_cursor_}}\zs', 'w') + silent! call search('\zs{{_cursor_}}', 'w') silent! foldopen - silent! call feedkeys(repeat("\<bs>", 12)) + silent! normal! "_da} endif break endif |