vim-denops / denops.vim

🐜 An ecosystem of Vim/Neovim which allows developers to write cross-platform plugins in Deno

Home Page:https://vim-denops.github.io/denops-documentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a way to pass one-time callback function from Deno to Vim script

lambdalisue opened this issue · comments

Opposite to denops#callback#.... It is mainly used to write a library code like

await Buffer.open("new-buffer", {
  onClosed: () => {
    // Code here is invoked when the buffer is closed.
  },
});

To make this kind of feature, we need to invoke onClosed callback on BufWinLeave autocmd or whatever but it's not possible for now without exposing onClosed callback as plugin API.

Background: https://vim-jp.slack.com/archives/C01N4L5362D/p1622640308360400