mattn / vim-sonictemplate

Easy and high speed coding method
http://mattn.github.com/vim-sonictemplate
333 stars 42 forks source link

Error occurs when insert {{_inline_}} template with asyncomplete.vim #38

Closed sgur closed 4 years ago

sgur commented 4 years ago

I found an error when using sonictemplate-vim with asyncomplete.vim.

How to reproduce:

  1. Trigger the SonicTemplate with mapping such as <C-y>t (:Template command works correctly)
  2. Select a snippet using the {{_inline_}} keyword.

2020-01-09 09_17_23-Window

My template is like below:

has('gui_running') {{_inline_}}

Postfix completion also occurs same error.

2020-01-09 09_53_54-Window

The error occurred at autoload/asyncomplete/utils/_on_change/textchangedp.vim in asyncomplete.vim.

I assume that TextChangedP or TextChangedI event were triggered but InsertEnter was not triggered when expanding {{_inline_}} templates (at #L298 #L376).

I think this is fixed when adding noautocmd to normal! command but I have no idea that either this change affects to other part of sonictemplate functionalities or not.

noautocmd silent! exe "normal! a\<c-r>=c\<cr>"
mattn commented 4 years ago

Yes, your code in suggestion is right. Could you please make PR ?