John Yeung:
The rule I'm looking for is "if the line ends in
a colon, indent the next one", but I don't know how or if it is possible at all
in SciTE. Something along the lines of
statement.indent.$(file.patterns.py)=10 :\n
You also need to consider lines that contain extra whitespace or
comments before the line end.
Anyway, the keyword indentation strategy brings me to Java, because the C++
properties file is where I first noticed keywords being used for that purpose.
Someone recently posted to the Scintilla project page that his Java code is
being autoindented when he uses 'private' (one of the indentation keywords) to
declare variables, as opposed to methods.
There is a difference here between Java and C++ where 'private' is
a label but the two languages share file.patterns.c.like so share
statement.indent.$(file.patterns.c.like). I'll try to fix this up.
Still, I think a better rule would be "if the current line ends with an open
curly brace, indent the next line" rather than "if the current line contains
<blah>, then indent the next line unless there is a subsequent <blahblah>".
The current rule is to allow for single statement ifs:
if (c)
f();
I'm sure a more accurate indenter can be implemented but there are
quite a few cases to consider.
Neil
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest