[Geany] Patch - Indentation Preferences '}'

Enrico Tröger enrico.troeger at xxxxx
Sun Nov 5 22:07:09 UTC 2006


On Sat, 04 Nov 2006 21:45:05 -0500, Bob Doan <bdoan at sicom.com> wrote:

> Hymm.. Perhaps the bug is with auto indentation.
>
> The problem w/ auto indentation right now(minus the patch) w/ c like
> languages, is any time the '}' is used it tabs it over tab, so If I
> try to insert a '}' at col 1, and tabs=4 the '}' gets inserted at col
> 5.
Ok, now I got the point. I didn't understood it at the first time,
sorry. This should be fixed with r969.
The problem was, the inserted } was indented with the indentation of
the previous line when an opening brace was found otherwise it got the
last used indentation and this was wrong. Now the } will only be
indented when an opening brace was found.

if you didn't meant this, I found an additional bug ;-).

> This code:
>
> if ((pos > sci_get_end_styled(sci)) || (styAtPos == styBrace))
>
> Is not always going to work, specifically the pos >
> sci_get_end_styled(sci) when we are moving backwards.  It doesn't find
> the matching '{' because of this, -1 gets returned and somehow an
> extra tab gets inserted.
The extra tab is not inserted anymore, see above. I think (pos >
sci_get_end_styled(sci) is correct it is some kind of fallback if the
lexer or container(in Geany it is always the lexer) doesn't styled the
whole document. But this should never be the case(at least I never saw
the case).

> I don't see why we need function is needed at all, perhaps I'm missing
> something.
It is needed to find a matching brace backwards because the Scintilla
message SCI_BRACEMATCH doesn't find it correctly.

Regards,
Enrico

--
Get my GPG key from http://www.uvena.de/pub.key

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20061105/4305ccde/attachment.pgp>


More information about the Users mailing list