After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691757 - warnings same color independent of style used
warnings same color independent of style used
Status: RESOLVED FIXED
Product: gedit-latex
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: José Aliste
Gedit maintainers
: 679392 730432 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-01-15 01:33 UTC by Carnë Draug
Modified: 2019-02-22 03:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix latex style (5.42 KB, patch)
2013-01-16 01:34 UTC, Carnë Draug
rejected Details | Review
fix oblivion style (912 bytes, patch)
2013-01-16 01:34 UTC, Carnë Draug
rejected Details | Review
screenshot showing how serious the bug is (131.70 KB, image/jpeg)
2013-03-07 11:49 UTC, Carnë Draug
  Details
Patch: use a color from the style (3.24 KB, patch)
2016-03-05 11:55 UTC, Pietro Battiston
none Details | Review

Description Carnë Draug 2013-01-15 01:33:17 UTC
The latex plugin always uses the same color to highlight warnings, independent of the style used. This is done on the file latex/latex/editor.py lines 75 and 76.

It uses  self._preferences.get() to obtain error and warning color. Independent on the style used, this does not change. If using the oblivion style, the warning highlight makes it impossible to even read the text.

To replicate, change style to oblivion and start a new latex file. The following text will show the problem:

\documentclass{article}
\begin{document}
  \label{a}
\end{document}

the string "\label{a}" is not readable at all. Change the style and note that the color does not change. This should be dependent on the style in use.
Comment 1 Carnë Draug 2013-01-16 01:34:15 UTC
Created attachment 233555 [details] [review]
fix latex style
Comment 2 Carnë Draug 2013-01-16 01:34:43 UTC
Created attachment 233556 [details] [review]
fix oblivion style

Please see attached patches to do my proposed changes. I have removed those from the oblivion style and use string or special char for display and inline math.

The ideas behind the difference is that when uses inline math, it's for a short equation, sometimes, even just a math symbol on the text. And so gets highlighted as special char.

When someone uses display math, then it's a much longer thing, most times on their own line. And so gets hightlighted as string.

I tried to highlight as the actual \begin{displaymath} environment but because \end is a normal command and gets included inside the maths, the \end is never caught.

If approved, I can push the changes.
Comment 3 Carnë Draug 2013-01-16 20:09:20 UTC
Review of attachment 233555 [details] [review]:

attached patch to the wrong bug report
Comment 4 Carnë Draug 2013-01-16 20:09:33 UTC
Review of attachment 233556 [details] [review]:

attached patch to the wrong bug report
Comment 5 Carnë Draug 2013-03-07 11:49:40 UTC
Created attachment 238281 [details]
screenshot showing how serious the bug is

I know this bug looks like a minor annoyance, an opinion on style of what looks good or hard to read. But please, take a look at the attachment. This is a screenshot of gedit editing a bibtex file. It is just *not* possible to edit it.

This bug makes a couple of the latex-plugin bugs much more serious since the latex-plugin makes heavy use of the default warning color. The attachment, shows its problem in conjunction with bug #692681.

Other bugs that get affected by this are bug #691758 and bug #695261. These are not duplicates, they are just minor bugs that get much aggravated in conjunction with this bug.
Comment 6 Ignacio Casal Quinteiro (nacho) 2013-03-07 11:54:34 UTC
To be honest I do not like that much the patch that you attached. Do you think we can actually fix the regex or if the problem is the color we might want to fix the color scheme.
Comment 7 Carnë Draug 2013-03-07 12:29:26 UTC
The attached patch was uploaded by mistake. It was meant for bug #691749 so I review it myself and marked as rejected.

Unfortunately, I do not know how to fix this one.
Comment 8 Carnë Draug 2013-03-07 13:35:58 UTC
While this is not fixed, it is possible to set the value manually using dconf-editor . The problematic values are question warning-background and error-background in org.gnome.gedit.plugins.latex.

Thanks to nacho for the tip (discussed on IRC).
Comment 9 Sébastien Wilmet 2013-03-29 16:17:30 UTC
*** Bug 679392 has been marked as a duplicate of this bug. ***
Comment 10 Pietro Battiston 2016-03-05 11:55:52 UTC
Created attachment 323147 [details] [review]
Patch: use a color from the style

I am attaching a patch which fixes the issue. It is not perfect because it should redefine colors when the current style is changed, without requiring the user to restart Gedit. But since the bug is long standing and annoying, and I currently don't have much time, I think it is worth pushing. I will wait a couple of weeks for comments however.

Notice are colors are defined in the settings, and they can probably pose the same problems.
Comment 11 Pietro Battiston 2016-03-05 11:56:36 UTC
(I meant "notice *other* colors are defined in the settings")
Comment 12 Sébastien Wilmet 2016-03-05 19:03:16 UTC
The latex gedit plugin is no longer maintained, see:
https://bugzilla.gnome.org/show_bug.cgi?id=698702#c23

Do you want to become the new maintainer?
Comment 13 Pietro Battiston 2016-03-11 22:26:58 UTC
I'm afraid I will not be able to increase significantly my effort in this plugin, but if you think this is acceptable and can save the plugin from certain death, then yes, I will step in as new maintainer (I do use it on a daily basis).
Comment 14 Sébastien Wilmet 2016-03-12 10:26:10 UTC
(In reply to Pietro Battiston from comment #13)
> I'm afraid I will not be able to increase significantly my effort in this
> plugin, but if you think this is acceptable and can save the plugin from
> certain death, then yes, I will step in as new maintainer (I do use it on a
> daily basis).

If you have the time, this would be helpful. But let's move the discussion about finding a new maintainer at bug #763525, to have a single place to discuss this.
Comment 15 Pietro Battiston 2016-03-21 09:05:30 UTC
Fixed in https://git.gnome.org/browse/gedit-latex/commit/?id=baabdfbe08a7ac07ccc65af7851bacc32e47a8e7 . I have also deleted from the schema three more colors which were not used anywhere:
https://git.gnome.org/browse/gedit-latex/commit/?id=38866d65c4a936563d51c6f4806ffe03ffa9f98d

There is one color left in the settings ("light-foreground-color"), but it is used for widgets rather than text, so it requires a different fix (if any).
Comment 16 Pietro Battiston 2016-05-01 09:25:42 UTC
*** Bug 730432 has been marked as a duplicate of this bug. ***