GNOME Bugzilla – Bug 686116
Right margin only appears in the first tab
Last modified: 2013-01-26 09:58:49 UTC
With gedit 3.6.0, I display a right margin at column 80. When I open gedit, the right margin is displayed in the default empty document, but for any new document, the right margin is hidden. Tested with the default Adwaita theme and some other themes.
It's a bit weird, but I don't think the right margin only works in the first tab. Instead the bug seems to be: if I open more than one file at a time from a terminal or Files (nautilus), the right margin is displayed in all except the first file.
Personally, I can confirm that the bug that I encounter is really that the right margin is only displayed in the first tab: - I open gedit. - By default, an empty new document is opened. The right margin is displayed. - I open a new document, so a new tab. - There's no right margin in this new tab (and in all subsequent tabs).
The right margin appears properly in other colour schemes (see gedit preferences) such as Tango, but not in the Classic scheme. I added a g_printf at the top of gtk_source_view_paint_right_margin to print the right margin colour - the colour is rgba(255,255,255,0.15686274509803921) when the right margin isn't displayed, so it's not visible because it's being drawn as white on white. Other colour schemes specify a right margin colour, but with Classic, there's no colour set, so gtksourceview reads a colour from the GTK+ theme. Possibly the bug is in gtksourceview not gedit.
I found a workaround: when you need the margin in some file then temporarily change the GEdit theme, just put another theme, then select again the theme you like and thats it!, it fixes the right margin for all files currently opened. There is no need to exit the dialog neither, just swapping the theme works.
I confirm the workaround works, but this is a very annoying bug. When wil this bug officially be confirmed?
Is this happening with gedit classic theme color? Are you all using a specific distribution? Here with gedit 3.6.x and fedora 18 does not happen.
(In reply to comment #6) > Is this happening with gedit classic theme color? Are you all using a specific > distribution? > > Here with gedit 3.6.x and fedora 18 does not happen. I'm using gedit 3.6.2 in F18 and it's happening. I use the classical theme. As mentioned above, if you change the theme the right margin appears for all the tabs you have already open. But if you open one more document, the new tab doesn't have the margin.
O_o indeed this seems to happen with the classic theme...
OK so I just quickly checked and this is an adwaita problem. The classic theme relies on the "background" color of the text view to draw the gutter and the right margin. Right now the color is white so both the gutter and the right margin are drawn in white so you can't actually see the right margin.
So it's the same root problem as bug #675785.
The problem isn't that the color is white, the problem is that gtksourceview doesn't read the color from the gtk theme reliably. e.g. if you do "gedit file1.txt file2.txt" you'll see the right margin in the second tab but not the first.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 675785 ***
Created attachment 234431 [details] [review] possible fix I didn't think this is the same as #675785 although it could be fixed in the same way by just setting a color in the gtksourceview style scheme.
Comment on attachment 234431 [details] [review] possible fix Not sure I understand this patch. Why would this change anything? If the right marging is white it will be white anyway... or am I missing anything here?
I must be the only person who ever opens two or more files at the same time (on one command line). If you open 3 tabs at the same time by doing: $ gedit 1 2 3 you will see the right margin in tabs 2 and 3 but not tab 1.
The main problem here is that all gedit maintainers are using the dark colors, so we didn't realized of this problem. But we are fixing it right now so expect a solution in a few hours.