Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Override 'use tab' settings for some languages (Python and Makefiles)

<< < (2/2)

hilborn:

--- Quote from: oBFusCATed on August 23, 2011, 11:25:32 pm ---Anyone against this patch? Any comments?

--- End quote ---
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 :( ).

oBFusCATed:
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

hilborn:

--- Quote from: oBFusCATed on May 27, 2012, 02:01:19 pm ---Here is the change: http://svn.berlios.de/wsvn/codeblocks/trunk/src/sdk/cbeditor.cpp?op=diff&rev=7411&peg=7411

--- End quote ---
Thanks!


--- Quote from: oBFusCATed on May 27, 2012, 02:01:19 pm ---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

--- End quote ---
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 :)

oBFusCATed:
I thought that pyople followed the pyctator rather passionately and without diverting from his commands! :)


--- Quote from: hilborn on May 27, 2012, 04:38:41 pm ---However it is also true that all code written in Python doesn't use spaces...

--- End quote ---
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.

Navigation

[0] Message Index

[*] Previous page

Go to full version