gEdit problem with color of selected text

I have a weird problem here using gEdit. It's gEdit 3.2 in Ubuntu 11.10.

When I select some piece of text, this should be white text on orange background (Unity 11.10 default).

Suddenly it started acting different: When I select text, it is white text on actual background color (white on black, for instance).

I don't know if it's related to gEdit or Unity, but sice Ubuntu 11.10 I can change only default font and theme in "Edit -> Preferences -> Fonts & Colors". No other "tweakable" option is available. The problem occurs no matter what theme I chose.

I have no idea why this happens and how to solve this. Has anyone seen something similar?


Solution 1:

Find the solution myself:

It was a style (theme) problem. Checked again using the default theme and this behave as expected. So I inspected carefully the other themes and found that not all those themes had this problem.

The solution was to edit the theme's code (twilight.xml) to insert the following lines:

<style name="selection" background="orange" />
<style name="selection-unfocused" foreground="white" background="gray" />

By the way, the location of the themes in gEdit 3 differ from gEdit 2. Here it is:

~/.local/share/gtksourceview-3.0/styles/

You can create the directory yourself if it doesn't exist. Further info on style paths here: http://live.gnome.org/GtkSourceView/StyleSchemes