ivanov/vim-ipython

python bug

scholi opened this issue · 0 comments

Hi it seems that running the file by pressing F5 fail because the filename is put into simple quote by using repr . Note: This only works with IPython 4.2 and lower. This can be fixed by changing function run_this_file from ftpplugin/python/vim_ipython.py as follow:

@with_subchannel
def run_this_file(flags=''):
    ext = os.path.splitext(vim.current.buffer.name)[-1][1:]
    if ext in ('pxd', 'pxi', 'pyx', 'pyxbld'):
        cmd = ' '.join(filter(None, (
            '%run_cython',
            vim_vars.get('cython_run_flags', ''),
            repr(vim.current.buffer.name))))
    else:
        cmd = '%%run %s "%s"' % (flags or vim_vars['ipython_run_flags'],
                               vim.current.buffer.name)
    msg_id = send(cmd)
    print_prompt(cmd, msg_id)

So mainly removing the repr and adding double quotes arount the %s