Hi,
Attached is a patch which adds a preferences for those who prefer coding styles like:
int foo() {
}
over
int foo() {
}
Let me know if it is ok.
I'll probably do the XML style one next
Also, The uvena.de DNS does not always resolve from different ISP's in the USA...
Thanks!
- Bob
On Fri, 03 Nov 2006 18:13:11 -0500, Bob Doan bdoan@sicom.com wrote:
Hi,
Attached is a patch which adds a preferences for those who prefer coding styles like:
int foo() {
}
over
int foo() {
}
Let me know if it is ok.
The patch is nice but I don't see any advantage. Your option and the if in sci_cb.c is just a second "Use auto indentation". It doesn't change the behaviour when typing } in one of the above cases. It will be completely disabled or enabled. Or am I overseeing anything?
Also, The uvena.de DNS does not always resolve from different ISP's in the USA...
Strange. I will have a look tomorrow. Can this host be related with one of your tries: 68-189-52-124.dhcp.rdng.ca.charter.com
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.key
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.
This makes coding things really annoying.
At this point I think my patch doesn't really solve any coding style problems, I think their is a bug in
brace_match (sci_cb.c)
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.
I don't see why we need function is needed at all, perhaps I'm missing something.
I need some more clues here...
- Bob
On Sun, 2006-11-05 at 00:40 +0100, Enrico Tröger wrote:
On Fri, 03 Nov 2006 18:13:11 -0500, Bob Doan bdoan@sicom.com wrote:
Hi,
Attached is a patch which adds a preferences for those who prefer coding styles like:
int foo() {
}
over
int foo() {
}
Let me know if it is ok.
The patch is nice but I don't see any advantage. Your option and the if in sci_cb.c is just a second "Use auto indentation". It doesn't change the behaviour when typing } in one of the above cases. It will be completely disabled or enabled. Or am I overseeing anything?
Also, The uvena.de DNS does not always resolve from different ISP's in the USA...
Strange. I will have a look tomorrow. Can this host be related with one of your tries: 68-189-52-124.dhcp.rdng.ca.charter.com
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.key _______________________________________________ Geany mailing list Geany@uvena.de http://uvena.de/cgi-bin/mailman/listinfo/geany
On Sat, 04 Nov 2006 21:45:05 -0500, Bob Doan bdoan@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
On Sun, 05 Nov 2006 17:04:55 -0500, Bob Doan bdoan@sicom.com wrote:
It works much better now.. Thanks!
So no need for my other patch as it is now, We might want to consider doing something w/ the automatic completing of things and the coding style in the future.
Yes, I think there should be. Also I want to modify the auto completion of constructs like if, for, while and so on. These should be changeable by users, at the moment it is all hardcoded (shame on me ;-)).
Regards, Enrico
P.S.: Sorry, I didn't send the last mail to the list, sent it again.
-- Get my GPG key from http://www.uvena.de/pub.key