esamattis / slimux

SLIME inspired tmux integration plugin for Vim
http://esa-matti.suuronen.org/blog/2012/04/19/slimux-tmux-plugin-for-vim/
Other
217 stars 52 forks source link

IndentationError: unindent does not match any outer indentation level (Extra spaces produced in IPython) #73

Closed Akramz closed 7 years ago

Akramz commented 7 years ago

This works perfectly fine ;

vim -

for i in range(1):
        for j in range(1):
                print 'Hello'

IPython [Using SlimuxREPLSendSelection] -

In [54]: for i in range(1):
   ....:        for j in range(1):
   ....:                        print 'Hello'
   ....: 
Hello

*Notice the spaces in my second indentation.

So when i try to indent back and do anything -

vim -

for i in range(1):
        for j in range(1):
                print 'Hello'
        print 'BUG!'

IPython -

In [55]: for i in range(1):
   ....:        for j in range(1):
   ....:                        print 'Hello'
   ....:                print 'BUG!'
   ....: 
  File "<ipython-input-55-007af182e978>", line 4
    print 'BUG!'
                ^
IndentationError: unindent does not match any outer indentation level

If you want to paste code into IPython, try the %paste and %cpaste magic functions.

IPython version : 4.2.1 vim version : 7.4

Any help would be appreciated, I really want to continue using Slimux.

Thank you.

Akramz commented 7 years ago

I solved the problem by disabling auto indent in IPython (%autoindent).

CermakM commented 6 years ago

I have this issue as well, how again did you solve it? %autoindent OFF in IPython does not solve the issue for me

$ipython3 --version
6.2.1
$vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec 11 2017 09:54:39)
zcesur commented 6 years ago

@CermakM See #80