{"action":"opened","issue":{"url":"https://api.github.com/repos/junegunn/vader.vim/issues/69","repository_url":"https://api.github.com/repos/junegunn/vader.vim","labels_url":"https://api.github.com/repos/junegunn/vader.vim/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/junegunn/vader.vim/issues/69/comments","events_url":"https://api.github.com/repos/junegunn/vader.vim/issues/69/events","html_url":"https://github.com/junegunn/vader.vim/issues/69","id":142175348,"number":69,"title":"[Proposal] Add WaitUntil block","user":{"login":"fflorent","id":371705,"avatar_url":"https://avatars.githubusercontent.com/u/371705?v=3","gravatar_id":"","url":"https://api.github.com/users/fflorent","html_url":"https://github.com/fflorent","followers_url":"https://api.github.com/users/fflorent/followers","following_url":"https://api.github.com/users/fflorent/following{/other_user}","gists_url":"https://api.github.com/users/fflorent/gists{/gist_id}","starred_url":"https://api.github.com/users/fflorent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fflorent/subscriptions","organizations_url":"https://api.github.com/users/fflorent/orgs","repos_url":"https://api.github.com/users/fflorent/repos","events_url":"https://api.github.com/users/fflorent/events{/privacy}","received_events_url":"https://api.github.com/users/fflorent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-20T15:52:18Z","updated_at":"2016-03-20T15:52:18Z","closed_at":null,"body":"I would love to be able to support asynchronicity through a `WaitUntil [autocmd-events] [(comments)]` block, like this:\r\n\r\n````\r\nExecute (some asynchronous job):\r\n  MyAsynchronousCommand\r\n\r\nWaitUntil BufNew,BufRead (new window pops up):\r\n  bufname('.') ==# '/tmp/foo' # Wait until a new buffer being created is /tmp/foo\r\n  # Other conditions here would be treated as AND conditions\r\n\r\nExpect:\r\n  some content in /tmp/foo\r\n````\r\n\r\nIf the `autocmd-events` are omitted, the WaitUntil would listen by default to a set of events (to determine) like BufNew, BufRead, BufWrite, CursorMove, ...\r\n\r\nThis would especially be helpful for asynchronous NeoVim plugins.\r\n\r\nThoughts?\r\n\r\n(If you think that is a good idea but lack time, I can try to propose you a patch)\r\n\r\nFlorent"}}