severin-lemaignan / vim-minimap

A Sublime-like minimap for VIM, based on the Drawille console-based drawing library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when using Python 2.6

timlag1305 opened this issue · comments

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))

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.

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.

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?

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

@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?

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

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.