Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 774e341

Browse files
author
Marcel Wolf
committed
invoke IPython's run magic as %run instead of run
If the source file defines or imports a symbol named 'run', that symbol takes precedence over IPython's run, leading to a syntax error being thrown when invoking run_this_file() Using %run removes the ambiguity.
1 parent 7e948b1 commit 774e341

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ftplugin/python/ipy.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ def with_subchannel(f,*args):
431431

432432
@with_subchannel
433433
def run_this_file():
434-
msg_id = send('run %s %s' % (run_flags, repr(vim.current.buffer.name),))
435-
print_prompt("In[]: run %s %s" % (run_flags, repr(vim.current.buffer.name)),msg_id)
434+
msg_id = send('%%run %s %s' % (run_flags, repr(vim.current.buffer.name),))
435+
print_prompt("In[]: %%run %s %s" % (run_flags, repr(vim.current.buffer.name)),msg_id)
436436

437437
@with_subchannel
438438
def run_this_line():

0 commit comments

Comments
 (0)