Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: oBFusCATed on August 23, 2011, 11:25:32 pm
-
Hello,
I've done a little patch, which overrides the use tab setting per language.
I've changed the behaviour for two languages:
1. Python - always use spaces (mixing spaces and tabs breaks the file)
2. Makefiles - always use tabs (using spaces breaks the makefile!)
Here is the patch: http://smrt.is-a-geek.org/codeblocks/patches/override_usetabs_per_language.patch
Anyone against this patch? Any comments?
-
Anyone against this patch?
No.
Any comments?
No.
:-)
-
Anyone against this patch? Any comments?
No.
-
OK, In svn...
-
OK, In svn...
Oh no! :lol: :lol: :lol:
-
Anyone against this patch? Any comments?
Yes.
I have recently been testing some nightly builds, to find out that Code::Blocks inserts spaces instead of a tab character, even though I've enabled the "Use TAB character" option.
This is counterintuitive and messes things up as I'm working with Python code were we are using tab characters (like you pointed out yourself, "mixing spaces and tabs breaks the file").
You might consider developing this feature further, by adding language-specific options or something in the Editor settings window.
I would really appreciate if this was not a hard-coded "invisible" feature (however the link to the patch seems broken, so I cannot see exactly what it's patching :( ).
-
Here is the change: http://svn.berlios.de/wsvn/codeblocks/trunk/src/sdk/cbeditor.cpp?op=diff&rev=7411&peg=7411
But as far as I know, people are encouraged to use spaces, when programming in python.
http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
-
Here is the change: http://svn.berlios.de/wsvn/codeblocks/trunk/src/sdk/cbeditor.cpp?op=diff&rev=7411&peg=7411
Thanks!
But as far as I know, people are encouraged to use spaces, when programming in python.
http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
This is true. However it is also true that all code written in Python doesn't use spaces; the recommendation only applies for new projects. (And some people still prefer tabs over spaces.)
The single most important recommendation is to never mix tabs and spaces, so if the editor forces the user to spaces there will be problems in projects where tabs are used.
This seems like an opportunity for me to dive into the Code::Blocks source code :)
-
I thought that pyople followed the pyctator rather passionately and without diverting from his commands! :)
However it is also true that all code written in Python doesn't use spaces...
What does it mean all here? All py-code I've seen is spaces only...
If you want to add an option the best place is in the Settings -> Editor-> General -> Other -> at the bottom.