SF.net SVN: geany:[2825] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Jul 27 18:41:07 UTC 2008


Revision: 2825
          http://geany.svn.sourceforge.net/geany/?rev=2825&view=rev
Author:   eht16
Date:     2008-07-27 18:41:07 +0000 (Sun, 27 Jul 2008)

Log Message:
-----------
Add a preference for the comment toggle mark string("~ " by default).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/geany.glade
    trunk/src/editor.c
    trunk/src/editor.h
    trunk/src/interface.c
    trunk/src/keyfile.c
    trunk/src/main.c
    trunk/src/plugindata.h
    trunk/src/prefs.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/ChangeLog	2008-07-27 18:41:07 UTC (rev 2825)
@@ -3,6 +3,9 @@
  * configure.in, wscript:
    Add support for retrieving the SVN revision number also
    when using a git-svn.
+ * geany.glade, doc/geany.html, doc/geany.txt, src/editor.c,
+   src/interface.c, src/keyfile.c, src/plugindata.h, src/prefs.c:
+   Add a preference for the comment toggle mark string("~ " by default).
 
 
 2008-07-25  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/doc/geany.html	2008-07-27 18:41:07 UTC (rev 2825)
@@ -6,7 +6,7 @@
 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
 <title>Geany</title>
 <meta name="authors" content="Enrico Tröger  Nick Treleaven  Frank Lanitz" />
-<meta name="date" content="2008-07-13" />
+<meta name="date" content="$Date$" />
 <style type="text/css">
 
 /*
@@ -139,7 +139,7 @@
 <br />Nick Treleaven
 <br />Frank Lanitz</td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2008-07-13</td></tr>
+<td>$Date$</td></tr>
 <tr><th class="docinfo-name">Version:</th>
 <td>0.15</td></tr>
 </tbody>
@@ -1718,6 +1718,9 @@
 <dt>Line breaking column</dt>
 <dd>The editor column number to insert a newline at when Line Breaking
 is enabled for the current document.</dd>
+<dt>Comment toggle marker</dt>
+<dd>A string which is added when toggling a line comment in a source file.
+It is used to mark the comment as toggled.</dd>
 </dl>
 </div>
 </div>
@@ -4172,7 +4175,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2008-07-13 11:47 UTC.
+Generated on: 2008-07-27 18:22 UTC.
 Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/doc/geany.txt	2008-07-27 18:41:07 UTC (rev 2825)
@@ -1499,7 +1499,11 @@
     The editor column number to insert a newline at when Line Breaking
     is enabled for the current document.
 
+Comment toggle marker
+    A string which is added when toggling a line comment in a source file.
+    It is used to mark the comment as toggled.
 
+
 Editor Completions tab in preferences dialog
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 

Modified: trunk/geany.glade
===================================================================
--- trunk/geany.glade	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/geany.glade	2008-07-27 18:41:07 UTC (rev 2825)
@@ -5828,6 +5828,64 @@
 				  <property name="fill">True</property>
 				</packing>
 			      </child>
+
+			      <child>
+				<widget class="GtkHBox" id="hbox12">
+				  <property name="visible">True</property>
+				  <property name="homogeneous">False</property>
+				  <property name="spacing">12</property>
+
+				  <child>
+				    <widget class="GtkLabel" id="label220">
+				      <property name="visible">True</property>
+				      <property name="label" translatable="yes">Comment toggle marker:</property>
+				      <property name="use_underline">False</property>
+				      <property name="use_markup">False</property>
+				      <property name="justify">GTK_JUSTIFY_LEFT</property>
+				      <property name="wrap">False</property>
+				      <property name="selectable">False</property>
+				      <property name="xalign">0.5</property>
+				      <property name="yalign">0.5</property>
+				      <property name="xpad">0</property>
+				      <property name="ypad">0</property>
+				      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				      <property name="width_chars">-1</property>
+				      <property name="single_line_mode">False</property>
+				      <property name="angle">0</property>
+				    </widget>
+				    <packing>
+				      <property name="padding">0</property>
+				      <property name="expand">False</property>
+				      <property name="fill">False</property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkEntry" id="entry_toggle_mark">
+				      <property name="visible">True</property>
+				      <property name="tooltip" translatable="yes">A string which is added when toggling a line comment in a source file. It is used to mark the comment as toggled.</property>
+				      <property name="can_focus">True</property>
+				      <property name="editable">True</property>
+				      <property name="visibility">True</property>
+				      <property name="max_length">0</property>
+				      <property name="text" translatable="yes"></property>
+				      <property name="has_frame">True</property>
+				      <property name="invisible_char">*</property>
+				      <property name="activates_default">False</property>
+				    </widget>
+				    <packing>
+				      <property name="padding">0</property>
+				      <property name="expand">False</property>
+				      <property name="fill">True</property>
+				    </packing>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">True</property>
+				  <property name="fill">True</property>
+				</packing>
+			      </child>
 			    </widget>
 			  </child>
 			</widget>

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/src/editor.c	2008-07-27 18:41:07 UTC (rev 2825)
@@ -1977,14 +1977,13 @@
 			/* use single line comment */
 			if (cc == NULL || strlen(cc) == 0)
 			{
-				gsize tm_len = strlen(GEANY_TOGGLE_MARK);
-
 				single_line = TRUE;
 
 				if (toggle)
 				{
+					gsize tm_len = strlen(editor_prefs.comment_toggle_mark);
 					if (strncmp(sel + x, co, co_len) != 0 ||
-						strncmp(sel + x + co_len, GEANY_TOGGLE_MARK, tm_len) != 0)
+						strncmp(sel + x + co_len, editor_prefs.comment_toggle_mark, tm_len) != 0)
 						continue;
 
 					co_len += tm_len;
@@ -2067,7 +2066,7 @@
 	gboolean break_loop = FALSE, single_line = FALSE;
 	gboolean first_line_was_comment = FALSE;
 	gsize co_len;
-	gsize tm_len = strlen(GEANY_TOGGLE_MARK);
+	gsize tm_len = strlen(editor_prefs.comment_toggle_mark);
 	GeanyFiletype *ft;
 
 	if (doc == NULL || doc->file_type == NULL)
@@ -2127,7 +2126,7 @@
 			single_line = TRUE;
 
 			if (strncmp(sel + x, co, co_len) == 0 &&
-				strncmp(sel + x + co_len, GEANY_TOGGLE_MARK, tm_len) == 0)
+				strncmp(sel + x + co_len, editor_prefs.comment_toggle_mark, tm_len) == 0)
 			{
 				do_continue = TRUE;
 			}
@@ -2310,7 +2309,7 @@
 
 				if (toggle)
 				{
-					gchar *text = g_strconcat(co, GEANY_TOGGLE_MARK, NULL);
+					gchar *text = g_strconcat(co, editor_prefs.comment_toggle_mark, NULL);
 					sci_insert_text(doc->editor->sci, start, text);
 					g_free(text);
 				}

Modified: trunk/src/editor.h
===================================================================
--- trunk/src/editor.h	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/src/editor.h	2008-07-27 18:41:07 UTC (rev 2825)
@@ -94,6 +94,7 @@
 	gboolean	detect_tab_mode;
 	gint		line_break_column;
 	gboolean	auto_continue_multiline;
+	gchar		*comment_toggle_mark;
 } GeanyEditorPrefs;
 
 extern GeanyEditorPrefs editor_prefs;

Modified: trunk/src/interface.c
===================================================================
--- trunk/src/interface.c	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/src/interface.c	2008-07-27 18:41:07 UTC (rev 2825)
@@ -2693,6 +2693,9 @@
   GtkWidget *label209;
   GtkObject *spin_line_break_adj;
   GtkWidget *spin_line_break;
+  GtkWidget *hbox12;
+  GtkWidget *label220;
+  GtkWidget *entry_toggle_mark;
   GtkWidget *label172;
   GtkWidget *label211;
   GtkWidget *frame18;
@@ -3736,6 +3739,19 @@
   gtk_box_pack_start (GTK_BOX (hbox11), spin_line_break, FALSE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin_line_break), TRUE);
 
+  hbox12 = gtk_hbox_new (FALSE, 12);
+  gtk_widget_show (hbox12);
+  gtk_box_pack_start (GTK_BOX (vbox17), hbox12, TRUE, TRUE, 0);
+
+  label220 = gtk_label_new (_("Comment toggle marker:"));
+  gtk_widget_show (label220);
+  gtk_box_pack_start (GTK_BOX (hbox12), label220, FALSE, FALSE, 0);
+
+  entry_toggle_mark = gtk_entry_new ();
+  gtk_widget_show (entry_toggle_mark);
+  gtk_box_pack_start (GTK_BOX (hbox12), entry_toggle_mark, FALSE, TRUE, 0);
+  gtk_tooltips_set_tip (tooltips, entry_toggle_mark, _("A string which is added when toggling a line comment in a source file. It is used to mark the comment as toggled."), NULL);
+
   label172 = gtk_label_new (_("<b>Features</b>"));
   gtk_widget_show (label172);
   gtk_frame_set_label_widget (GTK_FRAME (frame14), label172);
@@ -4886,6 +4902,9 @@
   GLADE_HOOKUP_OBJECT (prefs_dialog, hbox11, "hbox11");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label209, "label209");
   GLADE_HOOKUP_OBJECT (prefs_dialog, spin_line_break, "spin_line_break");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, hbox12, "hbox12");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, label220, "label220");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, entry_toggle_mark, "entry_toggle_mark");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label172, "label172");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label211, "label211");
   GLADE_HOOKUP_OBJECT (prefs_dialog, frame18, "frame18");

Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/src/keyfile.c	2008-07-27 18:41:07 UTC (rev 2825)
@@ -276,6 +276,7 @@
 	g_key_file_set_boolean(config, PACKAGE, "pref_editor_newline_strip", editor_prefs.newline_strip);
 	g_key_file_set_integer(config, PACKAGE, "line_break_column", editor_prefs.line_break_column);
 	g_key_file_set_boolean(config, PACKAGE, "auto_continue_multiline", editor_prefs.auto_continue_multiline);
+	g_key_file_set_string(config, PACKAGE, "comment_toggle_mark", editor_prefs.comment_toggle_mark);
 
 	/* files */
 	g_key_file_set_string(config, PACKAGE, "pref_editor_default_new_encoding", encodings[file_prefs.default_new_encoding].charset);
@@ -600,6 +601,7 @@
 	editor_prefs.scroll_stop_at_last_line = utils_get_setting_boolean(config, PACKAGE, "scroll_stop_at_last_line", FALSE);
 	editor_prefs.line_break_column = utils_get_setting_integer(config, PACKAGE, "line_break_column", 72);
 	editor_prefs.auto_continue_multiline = utils_get_setting_boolean(config, PACKAGE, "auto_continue_multiline", TRUE);
+	editor_prefs.comment_toggle_mark = utils_get_setting_string(config, PACKAGE, "comment_toggle_mark", GEANY_TOGGLE_MARK);
 
 	/* Files
 	 * use current locale encoding as default for new files (should be UTF-8 in most cases) */

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/src/main.c	2008-07-27 18:41:07 UTC (rev 2825)
@@ -954,6 +954,7 @@
 	g_free(interface_prefs.tagbar_font);
 	g_free(interface_prefs.msgwin_font);
 	g_free(editor_prefs.long_line_color);
+	g_free(editor_prefs.comment_toggle_mark);
 	g_free(tool_prefs.context_action_cmd);
 	g_free(template_prefs.developer);
 	g_free(template_prefs.company);

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/src/plugindata.h	2008-07-27 18:41:07 UTC (rev 2825)
@@ -36,7 +36,7 @@
 
 /* The API version should be incremented whenever any plugin data types below are
  * modified or appended to. */
-static const gint api_version = 82;
+static const gint api_version = 83;
 
 /* The ABI version should be incremented whenever existing fields in the plugin
  * data types below have to be changed or reordered. It should stay the same if fields

Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c	2008-07-27 18:38:46 UTC (rev 2824)
+++ trunk/src/prefs.c	2008-07-27 18:41:07 UTC (rev 2825)
@@ -403,6 +403,9 @@
 	widget = lookup_widget(ui_widgets.prefs_dialog, "spin_tab_width");
 	gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), editor_prefs.tab_width);
 
+	widget = lookup_widget(ui_widgets.prefs_dialog, "entry_toggle_mark");
+	gtk_entry_set_text(GTK_ENTRY(widget), editor_prefs.comment_toggle_mark);
+
 	widget = lookup_widget(ui_widgets.prefs_dialog, "check_replace_tabs");
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), file_prefs.replace_tabs);
 
@@ -813,6 +816,10 @@
 
 
 		/* Editor settings */
+		widget = lookup_widget(ui_widgets.prefs_dialog, "entry_toggle_mark");
+		setptr(editor_prefs.comment_toggle_mark,
+			gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1));
+
 		widget = lookup_widget(ui_widgets.prefs_dialog, "spin_tab_width");
 		editor_prefs.tab_width = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list