Re: vim9script autocommand not recalled more than one time ??

瀏覽次數:7 次
跳到第一則未讀訊息

Doug Kearns

未讀,
2022年10月18日 上午8:38:072022/10/18
收件者:vim...@googlegroups.com
On Sun, 16 Oct 2022 at 08:17, Nicolas <niva...@gmail.com> wrote:
>
> Hi,
>
> Using some stuff in helper and calling them through autocommand defined in _vimrc,
> it seems called vim9 def function is just called one time.
>
>
> This is the autocmd in _vimrc
> import './vimfiles/plugged/nv-helper.vim/autoload/nvhelper.vim' as that
> autocmd BufEnter *.h,*.cpp :call that.TestImportedFunc()
>
> This is the vim9 func:
> export def TestImportedFunc(): void
> echomsg 'Imported Func is well called and tested.'
> enddef
>
>
> Don't understand why only on first buffer as cpp, the echomsg of this func so this func is called: just one time ?

It works for me with Vim 9.0.0769.

Regards,
Doug

Nicolas

未讀,
2022年10月18日 中午12:28:032022/10/18
收件者:vim_use
Yes it works also as this :

in vimfiles/helper/autoload/helper.vim
export def TestExportedFunc(): void
  echomsg 'Exported Func Test is well imported and called for file ' .. expand("%:p")
enddef

in _vimrc
if has('autocmd')
  autocmd BufEnter *.h,*.cpp call that.TestExportedFunc()


Thank you Doug
Nicolas
回覆所有人
回覆作者
轉寄
0 則新訊息