<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi there!<br>
<br>
I'd very much like to see some auto-parentheses indentation in Geany. I
mean that this kind of indentation would be auto-generated on typing:<br>
<tt>if (cond1 &&<br>
    fun_call (param1,<br>
              param2) &&<br>
    cond3)<br>
{<br>
  another_call (param1,<br>
                param2);<br>
  /* and so on */<br>
}<br>
</tt><br>
This includes:<br>
<ul>
  <li>Indent new lines to match the position of the last opening
parenthesis (lines 2, 3, 7);</li>
  <li>Automatically reduce indentation on closing parenthesis to fit
the indentation of it's matching opening one (lines 4, 5, 8).</li>
</ul>
I'm trying to get this to work (attached WIP patch, which works but
have caveats)[1], but I have a couple of problems (probably related to
my little habit of Scintilla) and questions.<br>
First, the problems:<br>
<ol>
  <li>How to know if a character is or not part of a comment, string or
so? (e.g. should be interpreted as a syntactic element by itself) I
need this to find the parenthesis -- and no, I can't do the same than
brace_match() since I don't know the position of any of the parentheses.</li>
  <li>Why brace_match() uses the character at <tt>(pos - 1)</tt> but
the style at <tt>(pos)</tt>? This seems to be needed for brackets but
breaks with parentheses (see comments in the WIP patch).</li>
</ol>
And now the unique question (not that urgent since the patch isn't
ready): how to add this as part of the auto-indentation? (I mean,
always enable it -- I don't think everybody will like --, add a new
indent method, a new separated setting, or what?)<br>
<br>
Thanks for your help!<br>
Colomban<br>
<br>
<br>
[1] But if anybody would like to do this, I'd be happy to let him/her
do :D<br>
</body>
</html>