vim-repl icon indicating copy to clipboard operation
vim-repl copied to clipboard

Ipython magic function support.

Open roachsinai opened this issue 5 years ago • 1 comments

Describe the bug

When using %%timeit to get exec time of a code block, like below:

%%timeit
mean, var = 0., 0.
for i in range(1000000):
    x = np.random.randn()
    a = np.random.randn()
    z = np.random.randn()
    m = np.random.randn()
    y = x * a * z * m
    mean += y
    var += y**2
mean / 1000000, math.sqrt(var / 1000000)

Get indent error when using SendLineToREPL(post below).

Screenshots

image

Additional context

From the Traceback like below, can find no spaces(indent) following each \n.

get_ipython().run_cell_magic('timeit', '', 'mean, var = 0., 0.\nfor i in range(1000000):\nx = np.random.randn()\na = np.random.randn()\nz =

roachsinai avatar Apr 21 '20 13:04 roachsinai

Good idea. I will fix it in a few days.

sillybun avatar Apr 26 '20 07:04 sillybun