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

[WIP] Async wrapper #4

Closed
wants to merge 3 commits into from
Closed

Conversation

nelstrom
Copy link
Contributor

Fixes issue #3.

@prabirshrestha
Copy link

@nelstrom a:message in neovim is an array where value is separated by \n. async.vim normalizes it to array even for vim8 so you need to join by \n. I do this in the async.vim sample (will update the docs to be clear about this)

function! s:job_err_cb(name, channel, message) abort
  echohl WarningMsg
  echom a:name . ': ' . join(a:message, "\n")
  echohl None
endfunction

@nelstrom
Copy link
Contributor Author

@prabirshrestha thanks for the advice!

@nelstrom
Copy link
Contributor Author

@prabirshrestha I'm a bit confused about what arguments are provided to the callbacks. In NeoVim, it looks like the callback receives arguments s:JobHandler(job_id, data, event) (from :help job-control-usage). I'm not sure what would be the equivalent in Vim8. Or does async.vim normalise Vim8 callback args to be the same as in NeoVim?

@prabirshrestha
Copy link

async.vim normalizes vim8 to neovim so you get the the same as neovim. s:JobHandler(job_id, data, event).
Feel free to send a PR in async.vim to add docs or improve README.md

@k-takata
Copy link
Owner

@nelstrom
Can you try async-wrapper branch?

let l:jobtype = ''

if has_key(a:opts, 'type')
if type(a:opts.type, v:t_string)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i fixed the bug on upstream async.vim. You would want to sync this with latest master.

@k-takata k-takata mentioned this pull request Mar 29, 2017
@k-takata
Copy link
Owner

I created a new PR based on this. See #5.

@k-takata k-takata closed this Mar 29, 2017
@nelstrom nelstrom deleted the async-wrapper branch March 29, 2017 22:28
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

Successfully merging this pull request may close these issues.

3 participants