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

python bug #161

Open
scholi opened this issue Jun 18, 2018 · 0 comments
Open

python bug #161

scholi opened this issue Jun 18, 2018 · 0 comments

Comments

@scholi
Copy link

scholi commented Jun 18, 2018

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

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

1 participant