SF.net SVN: geany:[4184] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Mon Sep 14 11:53:08 UTC 2009
Revision: 4184
http://geany.svn.sourceforge.net/geany/?rev=4184&view=rev
Author: ntrel
Date: 2009-09-14 11:53:08 +0000 (Mon, 14 Sep 2009)
Log Message:
-----------
Update syntax highlighting after changing the 'Invert syntax
highlighting colors' pref, instead of requiring a restart.
Remove filetypes.common invert_all option - use 'Invert syntax
highlighting colors' pref instead (closes #2854525).
Modified Paths:
--------------
trunk/ChangeLog
trunk/data/filetypes.common
trunk/doc/geany.html
trunk/doc/geany.txt
trunk/geany.glade
trunk/src/filetypes.c
trunk/src/filetypes.h
trunk/src/highlighting.c
trunk/src/interface.c
trunk/src/main.c
trunk/src/prefs.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/ChangeLog 2009-09-14 11:53:08 UTC (rev 4184)
@@ -2,6 +2,13 @@
* src/utils.c:
Fix opening filenames beginning with two dots (closes #2858487).
+ * src/interface.c, src/highlighting.c, src/prefs.c, src/filetypes.c,
+ src/filetypes.h, src/main.c, doc/geany.txt, doc/geany.html,
+ data/filetypes.common, geany.glade:
+ Update syntax highlighting after changing the 'Invert syntax
+ highlighting colors' pref, instead of requiring a restart.
+ Remove filetypes.common invert_all option - use 'Invert syntax
+ highlighting colors' pref instead (closes #2854525).
2009-09-13 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/data/filetypes.common
===================================================================
--- trunk/data/filetypes.common 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/data/filetypes.common 2009-09-14 11:53:08 UTC (rev 4184)
@@ -71,9 +71,6 @@
# 2 to draw the line below folded text
folding_horiz_line=2;0;false;false
-# only first argument is interpreted, sets whether all defined colours should be inverted
-invert_all=0;0;false;false
-
# only first and second argument is interpreted
# first argument: drawing of visual flags to indicate a line is wrapped. This is a bitmask of the
# values: 0 - No visual flags, 1 - Visual flag at end of subline of a wrapped line, 2 - Visual flag
Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/doc/geany.html 2009-09-14 11:53:08 UTC (rev 4184)
@@ -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="2009-08-25" />
+<meta name="date" content="2009-09-10" />
<style type="text/css">
/*
@@ -139,7 +139,7 @@
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
-<td>2009-08-25</td></tr>
+<td>2009-09-10</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.19</td></tr>
</tbody>
@@ -2151,12 +2151,8 @@
<h4><a class="toc-backref" href="#id105" id="display" name="display">Display</a></h4>
<dl class="docutils">
<dt>Invert syntax highlighting colors</dt>
-<dd><p class="first">Use white text on a black background and invert all colors.
-If the <tt class="docutils literal"><span class="pre">invert_all</span></tt> setting in <tt class="docutils literal"><span class="pre">filetypes.common</span></tt> is set, this
-option is always enabled. See <a class="reference" href="#special-file-filetypes-common">Special file filetypes.common</a>
-for details.</p>
-<p class="last">This option requires a restart of Geany. The value of this option</p>
-</dd>
+<dd>Invert all colors, by default this makes white text on a black
+background.</dd>
<dt>Show indendation guides</dt>
<dd>Show vertical lines to help show how much leading indentation there
is on each line.</dd>
@@ -3956,15 +3952,6 @@
</ul>
<p class="last"><em>Example:</em> <tt class="docutils literal"><span class="pre">folding_horiz_line=0;0;false;false</span></tt></p>
</dd>
-<dt>invert_all</dt>
-<dd><p class="first">Whether to invert all defined colors. This is useful if you like a
-dark background color(e.g. black) and do not want to change every
-single line. Please note, at time of writing this was only tested
-with the C syntax highlighting.</p>
-<p>Only first argument is interpreted. Set it to 1 to invert all
-colors.</p>
-<p class="last"><em>Example:</em> <tt class="docutils literal"><span class="pre">invert_all=0;0;false;false</span></tt></p>
-</dd>
<dt>line_wrap_visuals</dt>
<dd><p class="first">First argument: drawing of visual flags to indicate a line is wrapped.
This is a bitmask of the values:</p>
@@ -5413,7 +5400,7 @@
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2009-09-10 16:55 UTC.
+Generated on: 2009-09-14 11:50 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 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/doc/geany.txt 2009-09-14 11:53:08 UTC (rev 4184)
@@ -1883,13 +1883,9 @@
```````
Invert syntax highlighting colors
- Use white text on a black background and invert all colors.
- If the ``invert_all`` setting in ``filetypes.common`` is set, this
- option is always enabled. See `Special file filetypes.common`_
- for details.
+ Invert all colors, by default this makes white text on a black
+ background.
- This option requires a restart of Geany. The value of this option
-
Show indendation guides
Show vertical lines to help show how much leading indentation there
is on each line.
@@ -3517,17 +3513,6 @@
*Example:* ``folding_horiz_line=0;0;false;false``
-invert_all
- Whether to invert all defined colors. This is useful if you like a
- dark background color(e.g. black) and do not want to change every
- single line. Please note, at time of writing this was only tested
- with the C syntax highlighting.
-
- Only first argument is interpreted. Set it to 1 to invert all
- colors.
-
- *Example:* ``invert_all=0;0;false;false``
-
line_wrap_visuals
First argument: drawing of visual flags to indicate a line is wrapped.
This is a bitmask of the values:
Modified: trunk/geany.glade
===================================================================
--- trunk/geany.glade 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/geany.glade 2009-09-14 11:53:08 UTC (rev 4184)
@@ -6480,7 +6480,7 @@
<child>
<widget class="GtkCheckButton" id="check_highlighting_invert">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">Use white text on a black background and invert all colors, this option requires a restart of Geany</property>
+ <property name="tooltip" translatable="yes">Invert all colors, by default using white text on a black background</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Invert syntax highlighting colors</property>
<property name="use_underline">True</property>
Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/src/filetypes.c 2009-09-14 11:53:08 UTC (rev 4184)
@@ -379,7 +379,7 @@
ft->comment_open = NULL;
ft->comment_close = NULL;
ft->group = GEANY_FILETYPE_GROUP_MISC;
-
+
#define TXT2TAGS
ft = filetypes[GEANY_FILETYPES_TXT2TAGS];
ft->lang = 37;
@@ -1576,3 +1576,24 @@
{
return (idx >= 0 && idx < (gint) filetypes_array->len) ? filetypes[idx] : NULL;
}
+
+
+void filetypes_reload(void)
+{
+ guint i;
+
+ /* save possibly changed commands before re-reading them */
+ filetypes_save_commands();
+
+ /* reload filetype configs */
+ for (i = 0; i < filetypes_array->len; i++)
+ {
+ /* filetypes_load_config() will skip not loaded filetypes */
+ filetypes_load_config(i, TRUE);
+ }
+ /* update document styling */
+ documents_foreach(i)
+ document_reload_config(documents[i]);
+}
+
+
Modified: trunk/src/filetypes.h
===================================================================
--- trunk/src/filetypes.h 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/src/filetypes.h 2009-09-14 11:53:08 UTC (rev 4184)
@@ -156,6 +156,9 @@
void filetypes_read_extensions(void);
+void filetypes_reload(void);
+
+
GeanyFiletype *filetypes_index(gint idx);
GeanyFiletype *filetypes_detect_from_document(GeanyDocument *doc);
Modified: trunk/src/highlighting.c
===================================================================
--- trunk/src/highlighting.c 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/src/highlighting.c 2009-09-14 11:53:08 UTC (rev 4184)
@@ -100,7 +100,6 @@
{
GeanyLexerStyle styling[GCS_MAX];
FoldingStyle folding_style;
- gboolean invert_all;
gchar *wordchars;
} common_style_set;
@@ -393,7 +392,7 @@
static guint invert(guint icolour)
{
- if (common_style_set.invert_all)
+ if (interface_prefs.highlighting_invert_all)
return utils_invert_color(icolour);
return icolour;
@@ -565,9 +564,6 @@
1, 1, &tmp_style);
common_style_set.folding_style.marker = tmp_style.foreground;
common_style_set.folding_style.lines = tmp_style.background;
- get_keyfile_int(config, config_home, "styling", "invert_all",
- 0, 0, &tmp_style);
- common_style_set.invert_all = tmp_style.foreground;
get_keyfile_int(config, config_home, "styling", "folding_horiz_line",
2, 0, &tmp_style);
common_style_set.folding_style.draw_line = tmp_style.foreground;
@@ -596,8 +592,6 @@
common_style_set.styling[GCS_LINE_HEIGHT].background = tmp_style.background;
}
- common_style_set.invert_all = interface_prefs.highlighting_invert_all =
- (common_style_set.invert_all || interface_prefs.highlighting_invert_all);
get_keyfile_wordchars(config, config_home, &common_style_set.wordchars);
whitespace_chars = get_keyfile_whitespace_chars(config, config_home);
}
Modified: trunk/src/interface.c
===================================================================
--- trunk/src/interface.c 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/src/interface.c 2009-09-14 11:53:08 UTC (rev 4184)
@@ -3783,7 +3783,7 @@
check_highlighting_invert = gtk_check_button_new_with_mnemonic (_("Invert syntax highlighting colors"));
gtk_widget_show (check_highlighting_invert);
gtk_box_pack_start (GTK_BOX (vbox12), check_highlighting_invert, FALSE, FALSE, 0);
- gtk_tooltips_set_tip (tooltips, check_highlighting_invert, _("Use white text on a black background and invert all colors, this option requires a restart of Geany"), NULL);
+ gtk_tooltips_set_tip (tooltips, check_highlighting_invert, _("Invert all colors, by default using white text on a black background"), NULL);
check_indent = gtk_check_button_new_with_mnemonic (_("Show indentation guides"));
gtk_widget_show (check_indent);
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/src/main.c 2009-09-14 11:53:08 UTC (rev 4184)
@@ -1182,8 +1182,6 @@
**/
void main_reload_configuration(void)
{
- guint i;
-
/* reload templates */
templates_free_templates();
templates_init();
@@ -1195,18 +1193,8 @@
/* reload filetype extensions */
filetypes_read_extensions();
- /* save possibly changed commands before re-reading them */
- filetypes_save_commands();
+ filetypes_reload();
- /* reload filetype configs */
- for (i = 0; i < filetypes_array->len; i++)
- {
- /* filetypes_load_config() will skip not loaded filetypes */
- filetypes_load_config(i, TRUE);
- }
- documents_foreach(i)
- document_reload_config(documents[i]);
-
/* C tag names to ignore */
symbols_reload_config_files();
Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c 2009-09-14 11:14:23 UTC (rev 4183)
+++ trunk/src/prefs.c 2009-09-14 11:53:08 UTC (rev 4184)
@@ -56,6 +56,7 @@
#include "toolbar.h"
#include "stash.h"
#include "keyfile.h"
+#include "filetypes.h"
#ifdef HAVE_VTE
# include "vte.h"
@@ -739,10 +740,14 @@
GtkWidget *widget;
guint i;
guint autoclose_brackets[5];
+ gboolean old_invert_all = interface_prefs.highlighting_invert_all;
/* Synchronize Stash settings */
prefs_action(PREF_UPDATE);
+ if (interface_prefs.highlighting_invert_all != old_invert_all)
+ filetypes_reload();
+
/* General settings */
/* startup */
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_load_session");
@@ -1581,7 +1586,7 @@
"font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(3));
g_signal_connect(ui_lookup_widget(ui_widgets.prefs_dialog, "long_line_color"),
"color-set", G_CALLBACK(on_prefs_color_choosed), GINT_TO_POINTER(1));
- /* file chooser buttons in the tools tab
+ /* file chooser buttons in the tools tab
g_signal_connect(ui_lookup_widget(ui_widgets.prefs_dialog, "button_make"),
"clicked", G_CALLBACK(on_prefs_tools_button_clicked), ui_lookup_widget(ui_widgets.prefs_dialog, "entry_com_make")); */
g_signal_connect(ui_lookup_widget(ui_widgets.prefs_dialog, "button_term"),
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