Revision: 898 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=898&view=rev Author: ctabin Date: 2009-08-14 10:26:09 +0000 (Fri, 14 Aug 2009)
Log Message: ----------- Pretty-Printer new configurable options for carriage return
Modified Paths: -------------- trunk/geany-plugins/pretty-printer/src/PluginEntry.c trunk/geany-plugins/pretty-printer/src/PluginEntry.h trunk/geany-plugins/pretty-printer/src/PrettyPrinter.c trunk/geany-plugins/pretty-printer/src/PrettyPrinter.h
Modified: trunk/geany-plugins/pretty-printer/src/PluginEntry.c =================================================================== --- trunk/geany-plugins/pretty-printer/src/PluginEntry.c 2009-08-13 21:16:29 UTC (rev 897) +++ trunk/geany-plugins/pretty-printer/src/PluginEntry.c 2009-08-14 10:26:09 UTC (rev 898) @@ -31,6 +31,11 @@
//========================================== DECLARATIONS ================================================================
+GeanyPlugin* geany_plugin; +GeanyData* geany_data; +GeanyFunctions* geany_functions; +PrettyPrintingOptions* prettyPrintingOptions; + static GtkWidget *main_menu_item = NULL; //the main menu of the plugin
//declaration of the functions
Modified: trunk/geany-plugins/pretty-printer/src/PluginEntry.h =================================================================== --- trunk/geany-plugins/pretty-printer/src/PluginEntry.h 2009-08-13 21:16:29 UTC (rev 897) +++ trunk/geany-plugins/pretty-printer/src/PluginEntry.h 2009-08-14 10:26:09 UTC (rev 898) @@ -16,6 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
+//TODO is this header really useful ? #ifndef PLUGIN_ENTRY_H #define PLUGIN_ENTRY_H
@@ -38,11 +39,7 @@
//========================================== PROPERTIES ========================================================
-GeanyPlugin* geany_plugin; -GeanyData* geany_data; -GeanyFunctions* geany_functions;
-PrettyPrintingOptions* prettyPrintingOptions;
//========================================== FUNCTIONS =========================================================
Modified: trunk/geany-plugins/pretty-printer/src/PrettyPrinter.c =================================================================== --- trunk/geany-plugins/pretty-printer/src/PrettyPrinter.c 2009-08-13 21:16:29 UTC (rev 897) +++ trunk/geany-plugins/pretty-printer/src/PrettyPrinter.c 2009-08-14 10:26:09 UTC (rev 898) @@ -144,6 +144,7 @@ return NULL; } + options->newLineChars = "\r\n"; options->indentChar = ' '; options->indentLength = 2; options->oneLineText = TRUE; @@ -204,7 +205,7 @@
int putNewLine() { - putCharInBuffer('\r\n'); + putCharsInBuffer(options->newLineChars); int spaces = currentDepth*options->indentLength; int i; for(i=0 ; i<spaces ; ++i)
Modified: trunk/geany-plugins/pretty-printer/src/PrettyPrinter.h =================================================================== --- trunk/geany-plugins/pretty-printer/src/PrettyPrinter.h 2009-08-13 21:16:29 UTC (rev 897) +++ trunk/geany-plugins/pretty-printer/src/PrettyPrinter.h 2009-08-14 10:26:09 UTC (rev 898) @@ -43,6 +43,7 @@ */ typedef struct { + char* newLineChars; //char used to generate a new line (generally \r\n) char indentChar; //char used for indentation int indentLength; //number of char to use for indentation (by default 2 spaces) gboolean oneLineText; //text is put on one line
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.