[IPython-user] Remove leading blank?

Fernando Perez Fernando.Perez at colorado.edu
Fri Sep 15 23:04:48 CDT 2006


Bo Peng wrote:

> Thank you very much for your reply.
> 
> Ehmm, isn't 'cpaste' + paste + '--' more troublesome than if 1:? 

Yes, but it exists today :)

The problem is that ipython is a command-line application, so it has no event 
handling mechanism, hence no way of knowing that code is being pasted.  It 
would be possible to strip leading space of all input if a new block starts 
with whitespace, but that has not been implemented.  cpaste exists today, so 
that was the easy answer.

Implementing auto-dedenting would add a bit to the already complex logic of 
auto-indenting.  I'm focusing on other things right now, but if anyone is 
interested in working on it, I'm sure patches would be welcome.

Cheers,

f



More information about the IPython-user mailing list