-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Terminal vim invokes GUI in the background when omni-completing python #392
Comments
can you repro it with this option?
I think the root cause might be some python omnicompletion plugin? |
First, the problem is with command line version of MacVim not GUI (problem is that command line MacVim invokes GUI in the background). So invoking GUI version of MacVim is pointless. Second, you must have filetype detection on or else omnifunction is not set for any file type. So, no I cannot reproduce it with the suggested options since there is no omnifunc defined with those options. Note that omnifunc is set by Vim's default filetype plugin located in
So, if I rename my ~/.vim directory I can still reproduce this. It is not a third party plugin that I may have installed or anything like that. |
Have you checked the issue in Vim? |
Yes, as mentioned in the original report, if I compile vim (not macvim) from source and install in /usr/local/bin the problem is not there. But then again this vim is built without GUI support. And as mentioned already python completion does not work for matplotlib. It works for everything else. Not sure why only matplotlib completion is special and has this weird behavior. |
OK, so I spent some time debugging this. It turns out
script invokes python script, which in turn evals the statement
which in turn launches GUI python. Normally, if you invoke the above import from IPython, it will also load and bounce the Python's rocketship icon on the dock. This is because matplotlib invokes interactive plot backend. But in Terminal MacVim version's case, it bounces the MacVim GUI icon instead. |
I can reproduce this on macOS 10.12 Sierra and MacVim 8 Snapshot 112 (downloaded from here) but also MacVim compiled from source and with either against only system python or both system python and python3.
Lets' say I have following code snippet:
If I edit it in Terminal vim, navigate to the end of plt. enter INSERT mode and hit CTRL+x CTRL+o to omnicomplete the methods on plt.
This seems to invoke GUI version of MacVim in the background. The MacVim dock icon starts bouncing and remains bouncing until you exit the Terminal version of vim.
If you try to launch GUI macvim from Finder you get an error message "The application MacVim is not open anymore".
Note that this only seems to happen with matplotlib python package. I have tried a few others and this does not happen with them.
Note also that if I use vim 8 patch 46 that I compiled from source with system python support (no python3 support), this does not happen, most likely because it is not compiled with GUI support:
However, the completion for matplotlib does not work. You get "Patten not found" error. But it works for other python packages.
The text was updated successfully, but these errors were encountered: