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

Error when using Python 2.6 #41

Open
timlag1305 opened this issue Apr 29, 2016 · 7 comments
Open

Error when using Python 2.6 #41

timlag1305 opened this issue Apr 29, 2016 · 7 comments

Comments

@timlag1305
Copy link

I am using Vim 7.4 with Python 2.6 (because CentOS) and I found that minimap doesn't work with this combination. You might want to either note the minimum version of python in the README.

I was able to get rid of the errors by changing the following line in minimap.py:
vim.command("match " + highlight_group + " /\%>0v\%<{}v\%>{}l\%<{}l./".for mat(WIDTH + 1, top, bottom))
to:
vim.command("match " + highlight_group + " /%>0v%<{0}v%>{1}l%<{2}l./".for mat(WIDTH + 1, top, bottom))

@severin-lemaignan
Copy link
Owner

Thanks for the report. I'll check if the later str.format syntax work on py 2.7/py 3, and I'll update the code accordingly.

@timlag1305
Copy link
Author

Thanks. The two big changes I made were

  1. \% to % because vim complained about it. I guess It couldn't execute the former regex.
  2. {} to {#} where # was the argument number and that is what Python 2.6 complained about.

You may not want to make the first change because I don't know if it is dependent on the version of vim.

@severin-lemaignan
Copy link
Owner

I've pushed the second change. Thanks!

The first change (\% to %) is less clear. Can you check if :help /\%> successfully returns the help for this operator in your version of vim?

@timlag1305
Copy link
Author

timlag1305 commented May 18, 2016

It returns the information associated with this: /\%c /\%>c /\%<c which is line 904 of my pattern.txt.gz. I hope that helps.

@severin-lemaignan
Copy link
Owner

@timlag1305 well, it just means that your vim does know about the operator \% :-)
So I'm really not sure why it complains. Could you copy-paste the error message?

@andreibalandin
Copy link

Use {1**:.0f**} and {2**:.0f**}, top and bottom are floats for whatever reason.

@timlag1305
Copy link
Author

timlag1305 commented Jun 16, 2016

So the error message is as follows
Error detected while processing function minimap#ShowMinimap:
line 2:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/tim/.vim/plugged/vim-minimap/autoload/minimap.py", line 97, in showminimap
vim.command(":call minimap#UpdateMinimap()")

@andreibalandin's solution fixed the error.

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

3 participants