aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormityu <mityu.email@gmail.com>2020-01-21 12:02:41 +0900
committermityu <mityu.email@gmail.com>2020-01-21 12:02:41 +0900
commitdf67b9647f8d5b75cc72d8d7d6054bdf8c2efad1 (patch)
treede612d9fd6b7ee7f6808bb48501ab54b8db0433e
parentb75b06bd0b099cb7e2c54863dbe91bc3a3028d5f (diff)
downloadvim-sonictemplate-df67b9647f8d5b75cc72d8d7d6054bdf8c2efad1.tar.gz
vim-sonictemplate-df67b9647f8d5b75cc72d8d7d6054bdf8c2efad1.tar.bz2
vim-sonictemplate-df67b9647f8d5b75cc72d8d7d6054bdf8c2efad1.zip
Fix expanding {{_cursor_}} does not work in insertmode
-rw-r--r--autoload/sonictemplate.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim
index 15fac9a..31492fe 100644
--- a/autoload/sonictemplate.vim
+++ b/autoload/sonictemplate.vim
@@ -322,7 +322,9 @@ function! sonictemplate#apply(name, mode, ...) abort
if stridx(c, '{{_cursor_}}') != -1
silent! call search('\zs{{_cursor_}}', 'w')
silent! foldopen
+ let curpos = getpos('.')
silent! normal! "_da}
+ call setpos('.', curpos)
endif
endfunction
@@ -373,7 +375,9 @@ function! sonictemplate#postfix()
if stridx(c, '{{_cursor_}}') != -1
silent! call search('\zs{{_cursor_}}', 'w')
silent! foldopen
+ let curpos = getpos('.')
silent! normal! "_da}
+ call setpos('.', curpos)
endif
break
endif