junegunn / junegunn/vader.vim

[Proposal] Add WaitUntil block

Open
#69 11 comments 0 reactions 1 assignee Claimed by @junegunn View on GitHub
Dominant language
Vim Script
Stars
599
Forks
40
PR merge metrics
No merged PRs in 30d

Description

I would love to be able to support asynchronicity through a `WaitUntil [autocmd-events] [(comments)]` block, like this:

```
Execute (some asynchronous job):
MyAsynchronousCommand

WaitUntil BufNew,BufRead (new window pops up):
bufname('.') ==# '/tmp/foo' # Wait until a new buffer being created is /tmp/foo
# Other conditions here would be treated as AND conditions

Expect:
some content in /tmp/foo
```

If the `autocmd-events` are omitted, the WaitUntil would listen by default to a set of events (to determine) like BufNew, BufRead, BufWrite, CursorMove, ...

This would especially be helpful for asynchronous NeoVim plugins.

Thoughts?

(If you think that is a good idea but lack time, I can try to propose you a patch)

Florent

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.