[MonoDevelop] Tabs to indent in text editor?

Sandy Armstrong sanfordarmstrong at gmail.com
Wed Feb 4 10:45:15 EST 2009


On 02/03/2009 07:28 PM, Michael Hutchinson wrote:
> On Tue, Feb 3, 2009 at 4:24 PM, Jeffrey Stedfast<fejj at novell.com>  wrote:
>> Dylan McCall wrote:
>>> I recently moved a little Python project into the MonoDevelop 2.0
>>> alphas. Fairly impressive stuff in here :)
>>>
>>> However, when I actually started working, I noticed something
>>> horrifying. Any automatic indentation was being done with 4 spaces!
>>> All of my earlier source code was indented with tabs. I prefer it that
>>> way, and will continue to prefer it that way as long as text editors
>>> require me to escape 4 characters to unindent. (In other words: If
>>> it's going to quietly indent with spaces, why can't it make those 4
>>> spaces feel like a single character?)
>>>
>>> The tabs vs. spaces flamewar is for another place, though. What I am
>>> wondering is: How can I configure this? I found Text Style under
>>> project and solution options, which lets me configure tab width in
>>> spaces. It also lets me convert tabs to spaces (no thank you). Any way
>>> to tell it "save some energy and indent with a single tab character
>>> instead"?
>>> For the time being I have had to turn off smart indenting, but that's
>>> rather an ugly band-aid type solution.
>>>
>> just uncheck the option "convert tabs to spaces" and it'll work exactly
>> the way you want, using a single tab for indenting.
>
> The Python binding's author hardcoded spaces in its smart indenter.
>
> http://anonsvn.mono-project.com/viewvc/trunk/monodevelop/extras/PyBinding/PyBinding/PyBinding.Gui/PythonEditorIndentation.cs?view=markup
>

Probably to comply with the recommendation in PEP-8 [1]:

"Use 4 spaces per indentation level."
"For new projects, spaces-only are strongly recommended over tabs."

Although I still think it should be up to the user to set this. :-)

Sandy

[1] http://www.python.org/dev/peps/pep-0008/


More information about the Monodevelop-list mailing list