nvie / vim-rst-tables

Easily create and reformat your RST (reStructuredText) tables as you change cell content.
121 stars 36 forks source link

Undefined variable: None using vim_bridge 0.4 #2

Closed matthew-brett closed 13 years ago

matthew-brett commented 13 years ago

Thanks for this very nice utility.

When I used the current github version of vim-rst-tables with the 'easy_install vim_bridge' version - as of today = 0.4 - I get errors running 'RefflowTable and ReformatTable of form 'Undefined variable: None'. These are fixed by appending 'return ''' to the 'reformat_table' and 'reflow_table' functions. Looking at 'vim_bridge' 0.5 - I guess that you've fixed this in the newest version of vim_bridge, but, still, it's confusing it doesn't work for the current easy_install version.

nvie commented 13 years ago

That's a bit odd, indeed. Actually, I have always found it a bit cumbersome that you need to install a Python package to be able to run a Vim plugin. Maybe I'll include the full contents of the vim_bridge plugin inside this package at one time, to avoid these dependency problems.

Thanks for the hint.

I've released vim_bridge 0.5 to PyPI, so everything should work now.

matthew-brett commented 13 years ago

Thanks for the reply. Yes, I copied vim_bridge to the 'ftplugin' directory, and edited the rst_tables.rst file:

from os.path import dirname

# get the directory this script is in: the vim_bridge python module should be installed there.
our_pth = dirname(vim.eval('expand("")'))
sys.path.insert(0, our_pth)

https://github.com/matthew-brett/myvim/tree/master/bundle/vim-rst-tables/ftplugin/

Of course then I thought it would be harder to send you back any edits :)