Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support skywind3000/asyncrun.vim as replacement for tpope/vim-dispatch #847

Closed
mcepl opened this issue Oct 14, 2016 · 4 comments
Closed

Comments

@mcepl
Copy link
Contributor

mcepl commented Oct 14, 2016

https://github.com/skywind3000/asyncrun.vim should be a replacement for tpope/vim-dispatch using async capabilities in vim8. The only usage of vim-dispatch I can find for me is in this function in vim-fugitive:

function! s:Dispatch(bang, args)
  let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
  let cwd = getcwd()
  let [mp, efm, cc] = [&l:mp, &l:efm, get(b:, 'current_compiler', '')]
  try
    let b:current_compiler = 'git'
    let &l:errorformat = s:common_efm
    let &l:makeprg = g:fugitive_git_executable . ' ' . a:args
    execute cd fnameescape(s:repo().tree())
    if exists(':Make') == 2
      noautocmd Make
    else
      silent noautocmd make!
      redraw!
      return 'call fugitive#cwindow()'
    endif
    return ''
  finally
    let [&l:mp, &l:efm, b:current_compiler] = [mp, efm, cc]
    if empty(cc) | unlet! b:current_compiler | endif
    execute cd fnameescape(cwd)
  endtry
endfunction

I guess just adding another branch to that if statement should be enough?

@tpope
Copy link
Owner

tpope commented Oct 14, 2016

Don't think of it as supporting dispatch.vim. Think of it as supporting any plugin that provides a :Make command. This is why I picked a generic command name. Much simpler for new async runners to provide a :Make command than for me to update half a dozen plugins.

@mcepl
Copy link
Contributor Author

mcepl commented Oct 15, 2016

Of course, another option would be to make vim-dispatch use native asynchronous capabilities of vim8 as well and make asyncrun redundant. ;)

@tpope
Copy link
Owner

tpope commented Oct 15, 2016

That would be great, though I'm pretty content with my setup so it hasn't been a high priority for me.

@tpope
Copy link
Owner

tpope commented Aug 15, 2019

Dispatch does use jobs now, fwiw.

@tpope tpope closed this as completed Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants