[Eric] Re: strip trailing whitespace

jorge.duenas at tttech.com jorge.duenas at tttech.com
Mon Dec 3 08:38:38 GMT 2007


Hello,

In order to strip all trailing whitespace I did the following quick 
modification in the Editor class' writeFile method (inside 
eric/modules/QScintilla.py):

        #ORIGINAL VERSION# f.write(txt)
        f.write('\n'.join ([s.rstrip () for s in txt.split ('\n')]))    # 
NEW VERSION

I.e., the removal happens when saving the file to disk. 

This is an ugly hack but until now I haven't noticed any bad side-effects. 
 Only wart: The editor does not notice the removal until you load the file 
again.

Note: I am using Eric 3.9.1

Hope this helps

Regards,

Jorge


More information about the Eric mailing list