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

fix guru output handling in Neovim #1846

Merged
merged 2 commits into from
May 30, 2018
Merged

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented May 30, 2018

Output from a Neovim job may come in batches and splits on newlines.
When the output ends with a newline, the last element in the data passed
to the stdout and stderr callbacks will be the empty string. When it's
not the empty string, then last element is an incomplete line, and the
next call will contain the rest of the line in the first element of its
data.

Join shell arguments correctly when Neovim calls guru.

Fixes #1836

bhcleek added 2 commits May 29, 2018 20:08
Join shell arguments correctly when Neovim calls guru.
Output from a Neovim job may come in batches and splits on newlines.
When the output ends with a newline, the last element in the data passed
to the stdout and stderr callbacks will be the empty string. When it's
not the empty string, then last element is an incomplete line, and the
next call will contain the rest of the line in the first element of its
data.

Fixes fatih#1836
@arp242
Copy link
Contributor

arp242 commented May 30, 2018

Isn't this a problem in all locations where we read from stdout/stderr in the async API?

Copy link
Contributor

@arp242 arp242 left a comment

Choose a reason for hiding this comment

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

Didn't test, but code seems okay.

@bhcleek
Copy link
Collaborator Author

bhcleek commented May 30, 2018

Your instincts are right; this is likely a problem in other places, too. It's not a problem everywhere, though, because some places use JSON instead of being line-oriented output. I'm planning to go through and unify the vim8 and Neovim async job handling so we can have a consistent approach. When I do that, I'll be sure to fix any code locations that also have this problem.

@bhcleek bhcleek merged commit 632ebb3 into fatih:master May 30, 2018
@bhcleek bhcleek deleted the fix-neovim-guru branch May 30, 2018 19:32
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.

2 participants