Latex Syntax Highliting dont work correct

Bug #66725 reported by Michael Trunner
4
Affects Status Importance Assigned to Milestone
gedit
Fix Released
Medium
gtksourceview (Ubuntu)
Fix Released
Wishlist
Ubuntu Desktop Bugs

Bug Description

The Latex Syntax highliting highlights \usepackage \begin and co. wrong.

Steps to reproduce:
1. write \usepackage[utf8]{inputenc}
2. add a space like this \usepac kage[utf8]{inputenc}
3. and remove it \usepackage[utf8]{inputenc}

Actual results:
Per default on the first step the color should be violet
After adding and removing the space it is green and bold (that is the wrong
highliting)

Expected results:
It's violet again

Does this happen every time?
Yes

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your bug. Why do you consider the green coloration as wrong? Any "\something" is colored green. Maybe the patch from http://bugzilla.gnome.org/show_bug.cgi?id=361209 would make it better

Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Wishlist
status: Unconfirmed → Needs Info
Revision history for this message
Michael Trunner (trunneml) wrote :

Sorry for my bad english. :-/

No not everything should/is green. \usepackage violet and you can configure it seperate in the options of the Latex Syntax Highliting menu.
When I load a .tex File the \usepackage is correct but some \begin \end are red. If I edit something on it then its green.
In the config of the syntaxhighliting only catchwords ( I have the german version there is standing "Stichworte") should colored green. And instructions should be red. But some \end are red too.
If I add one or two new Lines above then it changes it color? I can't belive this is normal.
It makes no sense that one \end is red while others are green. And one \usepackage is green and the next is violet.
If all shoul be green, why I can configure Math, includes, instructions, ... with different colors?

Picture: The last \usepackage is green after editing it.
the last begin is green while the first is red. If I replace the b with b then its green.

Revision history for this message
Sebastien Bacher (seb128) wrote :

right that looks like non-ideal behaviour, the upstream bug I pointed might fix some of your issues, marking as confirmed since that's known upstream

Changed in gtksourceview:
status: Needs Info → Confirmed
Revision history for this message
Michael Trunner (trunneml) wrote :

The Problem is:

      <keyword-list _name="Command" style="Keyword" case-sensitive="TRUE"
                match-empty-string-at-beginning="FALSE"
                match-empty-string-at-end="FALSE"
                beginning-regex="\\">
                <keyword>\\</keyword>
                <keyword>begin</keyword>
                <keyword>end</keyword>
                <keyword>documentclass</keyword>
                <keyword>newcommand</keyword>
                <keyword>newenvironment</keyword>
                <keyword>newtheorem</keyword>
                <keyword>newfont</keyword>
                <keyword>part</keyword>
                <keyword>chapter</keyword>
                <keyword>section</keyword>
                <keyword>subsection</keyword>
                <keyword>subsubsection</keyword>
                <keyword>paragraph</keyword>
                <keyword>subparagraph</keyword>
                <keyword>page</keyword>
                <keyword>equation</keyword>
                <keyword>figure</keyword>
                <keyword>table</keyword>
                <keyword>footnote</keyword>
                <keyword>footnotemark</keyword>
                <keyword>footnotetext</keyword>
                <keyword>mpfootnote</keyword>
                <keyword>enumi</keyword>
                <keyword>enumii</keyword>
                <keyword>enumiii</keyword>
                <keyword>enumiv</keyword>
                <keyword>label</keyword>
                <keyword>pageref</keyword>
                <keyword>ref</keyword>
                <keyword>onecolumn</keyword>
                <keyword>twocolumn</keyword>
        </keyword-list>

        <pattern-item _name="Keyword" style="Others">
                <regex>\\[a-zA-Z]+</regex>
        </pattern-item>

Both are match the same string and gtksourceview don't know what to do. The keyword-list needs a higher priority or the pattern-item shouldn't match the same string.
Any Idea?

Revision history for this message
Sebastien Bacher (seb128) wrote : Re: [Bug 66725] Re: Latex Syntax Highliting dont work correct

Le mercredi 18 octobre 2006 à 20:13 +0000, Michael Trunner a écrit :

> Both are match the same string and gtksourceview don't know what to
> do. The keyword-list needs a higher priority or the pattern-item
> shouldn't match the same string.
> Any Idea?

Not really, upstream probably knows better about that

Changed in gedit:
status: Unknown → Unconfirmed
Revision history for this message
Sebastian Breier (tomcat42) wrote :

I'm sitting right next to Michael and we just checked it side-by-side with reset gedit configuration... he has the bug, I don't. It's really weird... we're now trying with new users to make sure it's not a user-configuration thing.

Revision history for this message
Sebastian Breier (tomcat42) wrote :

After creating new users the problem persisted. Then Michael noticed that I use English language on the desktop while he is on German language...

I installed language-pack-gnome-de, switched the new user to German - voila: I got the bug as well. I guess Sebastien uses French language, so he got the problem as well.

Revision history for this message
Sebastian Breier (tomcat42) wrote :

Bug was reported for dapper, but persists in edgy (I just checked).

Revision history for this message
Michael Trunner (trunneml) wrote :

Workaround:
$ LANGUAGE=en_US.UTF-8 gedit

Then GEDIT starts with english language and the syntax highliting works correct.

Changed in gedit:
status: Unconfirmed → Confirmed
Revision history for this message
Sebastian Breier (tomcat42) wrote :

Still in feisty.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the bug should be fixed in gutsy, closing, feel free to reopen if you still have the issue after upgrading though

Changed in gtksourceview:
status: Confirmed → Fix Released
Changed in gedit:
status: Confirmed → Fix Released
Changed in gedit:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.