Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyDev adding tabs to block indentation

I am using Eclipse Ingigo with Pydev 2.3.0.2011121518, it has been working great, but has suddenly starting doing this weird thing with tabs.

I have got the "Replace tabs with spaces when typing" option set for PyDev --> Editor in Eclipse preferences, and that works fine, when I press tab, I get 4 spaces. However for some rerason, now when I create a block, such as an "if" block pydev automatically indents the next line, as it should but this time it adds a tab, leading to "Mixed Indentation: Tab found" warnings.

Has anyone seen this behavior before, and know a fix, or is it a bug with Pydev on Eclipse Indigo?

like image 930
Ctrlspc Avatar asked Jan 20 '12 10:01

Ctrlspc


1 Answers

I have just solved this - I had the option ."Assume tab spacing when file contain tabs" checked in Eclipse Preferences --> PyDev --> Editor. When I unchecked this option the automatic indentation worked properly and it added spaces and not tabs. It seems that in one of my docstrings I had some tabs (possibly copied in from another editor), and that must have been making Eclipse assume tab spacing for automatic indentation (even though it was still replacing tabs with spaces as I typed them)

like image 183
Ctrlspc Avatar answered Nov 03 '22 05:11

Ctrlspc