n0v1c3 / vira

Create and update your Jira issues while inside Vim!
MIT License
94 stars 12 forks source link

Works in neovim but not in vim. #72

Open xbot opened 3 years ago

xbot commented 3 years ago

This plugin works perfectly in neovim, but complained the following errors in vim:

Error detected while processing function vira#_menu:
line   39:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'Vira' is not defined

Vim has +python3 enabled.

n0v1c3 commented 3 years ago

@xbot I hope the day is a good one.

These are always my favorite ones to hunt down on as it does appear to work on vim still.

I know it is worth a check of your whereis vim command and find out what the priority is. It may not be the same place that is getting updates anymore. Try run each one with full paths and see if there is a difference.

Issue #43 also is worth a look. We just kept talking until he got it to work. Also, give the dev branch a try if there is a difference there for you I will do a quick cleanup on that and merge to master.

I am definitely a vim user so I usually break the neovim without my double checking.

xbot commented 3 years ago

@n0v1c3 Thanks for your answer.

I tried these steps but the problem is still there.

The vim executable being used is the newest version installed by homebrew, not the system one of MacOS.

The dev branch works the same as master.

Issue #43 is for neovim, I find nothing helpful through it.

Another weird thing is, on my Macbook Pro, the problem is the other way around. Vira works in vim but not in neovim.

n0v1c3 commented 3 years ago

@xbox,

I think Mac is telling you to upgrade all systems to Pro now. 😁

If you want to dive in a bit with me. There is a function inside autoload that imports Vira. This function is where a path is added along with the import of the python side, vira#_init_python().

Take a look there and make sure it is at least getting these and the paths make sense. If you take of the silent! here you may get some more errors or simply echo some values.

xbot commented 3 years ago

@n0v1c3 Thank you very much. I finally found what the problem is.

The reason is, my vim uses a python3 installed by homebrew, but the shell runs the one installed by pyenv.

If it is possible that the install.sh find the real python installation used by vim before pip install jira, I think new users won't be bothered by this problem again.

n0v1c3 commented 3 years ago

@xbot I am glad to hear this one.

I am going to keep this issue open and it will most likely end up with a VIRA tag beside it so it can simply go away.