Skip to content

Output not captured in Quickfix for python scripts #30

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

Closed
heitzmann opened this issue Feb 2, 2017 · 9 comments
Closed

Output not captured in Quickfix for python scripts #30

heitzmann opened this issue Feb 2, 2017 · 9 comments

Comments

@heitzmann
Copy link

Output of python scripts is not displayed in the Quickfix window.

I have the following in a test.py file:

# File: test.py
print('Hello world!')

If I run :AsyncRun python test.py the Quickfix window does not display the message. It simply shows:

|| [python test.py]
|| 
|| [Finished in 0 seconds]

But if I execute :AsyncRun python -c 'print("Hello world!")' I correctly get:

|| [python -c 'print("Hello world!")']
|| Hello world!
|| 
|| [Finished in 0 seconds]

In bash, for example, it works fine. If I have a file test.sh with:

# File: test.sh
echo 'Hello world!'

and execute :AsyncRun bash test.sh I get:

|| [bash test.sh]
|| Hello world!
|| 
|| [Finished in 0 seconds]

What am I missing here? Is there a problem with python output?

@heitzmann heitzmann changed the title Output not captured in Quickfix for pytohn scripts Output not captured in Quickfix for python scripts Feb 2, 2017
@skywind3000
Copy link
Owner

I can't reproduce your issue on both Windows and Linux.

Can you provide some details about:

  1. version of vim
  2. version of asyncrun
  3. what os are you working on ?

@heitzmann
Copy link
Author

Sure, I forgot to mention that! I'm on Linux (4.9) and I'm using NeoVim 0.1.7, not vim, with the latest AsyncRun commit (1467e58).

@skywind3000
Copy link
Owner

skywind3000 commented Feb 10, 2017

It seems that output from stdout has been dropped by neovim 0.1.7 if the child process exits too immediately. NeoVim 0.1.7 may buffer the output from child process, but before passing to AsyncRun, it found job finished and simply discarded the buffering data.

But it seems okay in my NVIM v0.2.0-211-g9009c20, I could't reproduce your problem in nvim 0.2.0 either, maybe the issue has been fixed already ??

Maybe you can try to upgrade your nvim ?

@heitzmann
Copy link
Author

Thanks for the response. I get the same problem in neovim 0.2.
I've run many tests and it actually seems to be some incompatibility with vim-polyglot or some of its language packs.

The problem happens when the 1st buffer I load in neovim (or even vim 8.0.314 – I tested both) is a python file.
I've also seen this issue with latex files (compilation output is mostly missing, except for errors).

In any case, removing vim-polyglot solved the issue for now. Since the problem could be with vim-polyglot, feel free to close this issue.

@skywind3000
Copy link
Owner

Maybe global value of errorformat has been modified by vim-polyglot ?
errorformat can trim messages in quickfix (eg, u can configurate your errorformat to display errors only, not warnings or others).

Is it possible that somewhere in vim-polyglot changes your global errorformat ? If so , you can check the difference of errorformat when you are opening a .py file and a .sh file.

@heitzmann
Copy link
Author

You are right! The python language pack from vim-polyglot modifies errorformat. In fact, by searching in the repository I imagine many other languages would suffer from the same problem...

@skywind3000
Copy link
Owner

skywind3000 commented Feb 11, 2017

Since you find the problem, you can set it back, and this issue could be closed now.

@teleyinex
Copy link

Thanks to this I solved this issue for me as well :-) THANKS

@aemonge
Copy link

aemonge commented Sep 6, 2022

Is there a way to set the errorformat to a local QuickFix window of the AsyncRun, to support poliglot and more?

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

4 participants