Skip to content

python bug #161

Description

@scholi

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions