[Geany-Devel] Some comments on b4n regex-indent

Lex Trotman elextr at gmail.com
Sat Jan 26 02:49:52 UTC 2013


Hi Colomban,

Here are some comments on the subject branch.  Solutions left as an
exercise for the reader since I don't have any ;)

C language, which I assume represents all {} languages

1. Indents relative to the previous line, that means that (tabs, width=4):

if(long &&
   more){
       blah;

is wrong, blah is indented too far, and hard to fix because unindent
remains offset (by the extra indent of "more") until the start of the
line.  Maybe calculate new indent relative to the previous indent
level, not the alignment?

This is the same as current, and just as annoying :)

Can't find the gedit plugin, so tried emacs 23.4, it indented
correctly (including indenting "more") without any help from me, but
didn't indent at all until the ) after "more" and the ; after "blah"
which is really disconcerting but understandable.  I guess it has a
"brace match" type thing for the () and indents next line by { level
at ;.

2. Can't see brace matching problem?  Maybe define better.

3. Typing } anywhere (outside comment) causes a fluctuating indent,
annoying whilst editing.  Not really sure what is going on here, seems
very dependent on whats on this and the last line, can't find a
pattern.

4. probably part of the above:

if(long &&
   more){ do; it; }

removes the alignment of "more" when } is typed.  But as I read the
unindent regex, it shouldn't work unless the } is only preceded by
whitespace?

Python, seems ok, but as I said on IRC, I don't expect it to autoexdent.

Can't see anything new wrong with Ruby, but I don't know much what it needs.

You havn't done lisp or haskell yet :D

Cheers
Lex


More information about the Devel mailing list