Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4476584 By: mbaas
Hi, Pydev adds the functions "Convert tabs to space-tabs" and "Convert space-tabs to tabs" to the Source menu which are quite handy tools to clean up files that use a mixed style of tabs and spaces. However, I think they should work slightly different. What I would expect is that running those tools should never introduce indentation errors, but unfortunately, with the current version of Pydev this can happen. The problem is that Pydev takes the tab size from the current settings, but Python uses a tab size of 8. So when you convert tabs to spaces and the tab size is different from 8 the resulting code will have indentation errors. One other thing to watch out is that a single line might contain a mix of blanks and tabs in which case tabs must not be simply replaced with 8 blanks, but aligned to the next valid tab position. Or conversely, it can happen that you just have to remove some blanks without adding a tab. The indentation rules that Python follows are mentioned here: http://docs.python.org/ref/indentation.html So, is it possible to change those two conversion functions so that they will just clean up the source file without ever introducing indentation errors? (Or were those functions never meant to be cleanup functions but rather mere replacement functions?) - Matthias - PS: If you give me some hints where this code is actually located, I might even give it a try myself (if it's Python code instead of Java code). ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Pydev-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pydev-users
