Hi Enrico,
Thansk for your advices. As I never developped very much in C with header files I don't know what's the best... I just see in another plugin that it was done like that and thought that it was the right way. However I don't understand why the 'extern' before my gean_* variables didn't work. I just saw an error into the debug messages of Geany. Maybe you can explain me that ?
For the line returns, I put it it the struct configuration, so it will be configurable when I create the Preferences panel :-)
Regards,
Cedric
On Thu, 13 Aug 2009 10:47:14 +0000, ctabin@users.sourceforge.net wrote:
Hi,
>-extern GeanyPlugin* geany_plugin;
>-extern GeanyData* geany_data;
>-extern GeanyFunctions* geany_functions;
>+GeanyPlugin* geany_plugin;
>+GeanyData* geany_data;
>+GeanyFunctions* geany_functions;
sorry, I don't see the rational behind this. Even more, I think
everything in PluginEntry.h is not necessary.
You should declare the above listed symbols not in the header but
instead only in those source files which actually need them.
Same goes for the header includes.
It's not that the code is wrong but IMHO it's not the best way to
handle includes and global variables.
>Modified: trunk/geany-plugins/pretty-printer/src/PrettyPrinter.c
>===================================================================
>--- trunk/geany-plugins/pretty-printer/src/PrettyPrinter.c
>2009-08-12 11:18:39 UTC (rev 894) +++
>trunk/geany-plugins/pretty-printer/src/PrettyPrinter.c
>2009-08-13 10:47:14 UTC (rev 895) @@ -204,7 +204,7 @@
>
> int putNewLine()
> {
>- putCharInBuffer('\n');
>+ putCharInBuffer('\r\n');
> int spaces = currentDepth*options->indentLength;
> int i;
> for(i=0 ; i<spaces ; ++i)
Not completely sure when this code is used and so I might be wrong. But
if you want to insert line breaks, you can use the Geany preference
'file_prefs.default_eol_character' to insert these line break
characters the user chose in his personal settings. I personally don't
like to get any CRLF's auto-inserted in my files as I use LF
exclusively.
Regards,
Enrico
--
Get my GPG key from http://www.uvena.de/pub.asc
_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel