use.tabs=0
indent.size=4
by default?
The standard behaviour of most editors is to use 8 space tabs and
to insert tab characters when the tab key is used. If you prefer
something else then set the properties to match your preferences. If
you want the indentation settings to match existing indentation when
opening a file you could use indent.auto.
Neil
That's even better :)
The thing is that I've never seen python code with tab indentation (nor it is recommended as a python style) and when changing something in the code (for example just hitting Enter) SciTE uses tab by default and code is ruined. Ruining strict python indentation is just so often when inexperienced users copy/paste code with almost any editors, as I've noticed, but that more general issue
indent.auto option seems like good idea to me for default python. properties file
> indent.auto option seems like good idea to me for default python. properties file
Its a global option so does not belong in python.properties.
It is also a bit dangerous as it overrides explicit settings for
using tabs and tab size. I'm sure if a new version of SciTE was
released with indent.auto=1 then there would be many bug reports:
"SciTE is ignoring my tab.size setting".
Neil
http://www.artima.com/weblogs/viewpost.jsp?thread=143947
Guido himself on his tab policy:
"Fortunately it's easy to separate the two. If it uses two-space
indents, it's corporate code; if it uses four-space indents, it's open
source. (If it uses tabs, I didn't write it! :-)"
Tab use is something like a religious issue. Which is why SciTE
shouldn't interfere with other people's tab settings ;)
steve d.
- If I start to write new python code, tabs are set as default set in SciTE (no one can complain)
- If I edit existing code, indentation is preserved: with or without tab, and that's automagically
Am I overseeing something?
> Why are you suggesting indent.auto to be used globally?
I am not. I am saying that indent.auto *is* a global property. If
you set it in python.properties, it will also affect C++ and HTML and
Ada...
The language properties files are not active only when that
language is in use. All the language properties files are active all
the time.
Neil
> I don't know where is this topic going, but I think I suggested reasonable
> request
Your request is unworkable as explained.
>> If you set it in python.properties, it will also affect C++ and HTML
>> and Ada...
>
> That is not happening here, nor I see that logic.
I don't know why you are not seeing this but I have explained how it works.
> + indent.auto is commented in my global.properties
The "import python" statement includes python.properties into
global properties and you set indent.auto in python.properties so the
effect is as if indent.auto was set in global properties.
Neil
OK, I tried to save some beginner python souls :)
As if somebody is new to SciTE, I guess setting indenting options in properties text file would not be his/her first step
It's a nice thought, but I think tabs vs. spaces is not a big problem
in SciTE because it is quite easy to fix. What I don't like about
SciTE for Python is that it doesn't really handle autoindentation. It
only gives you two choices: (1) Look for colons, and mistakenly
indent when you are just using slices; or (2) look for keywords, and
mistakenly indent when you are using list comprehensions or generator
expressions.
The only way, as far as I know, to provide correct Python
autoindentation is to patch the source, which I haven't done since
1.76 (so that is the version I am still using).
> As if somebody is new to SciTE, I guess setting indenting
> options in properties text file would not be his/her first step
Perhaps not their first step, but much easier than rebuilding SciTE from source.
John