Syntax highlighting not working on CAPITAL LETTERS (Fortran 90)

Asked by Leperous

Since upgrading to Gutsy the other day, gedit 2.20.1 is not syntax highlighting most of my UPPER CASE FORTRAN (90) CODE. 'CALL' is about the only thing being highlighted, and yes, 'Fortran 90' highlighting is currently selected. This goes for existing .f90 files, or if I make new ones.

Lower case functions, loops etc. are highlighted fine. I do not particularly wish to change all my code to lowercase, or to move to emacs...

Also, the comment/uncomment code in-built plugin doesn't seem to work properly either for Fortran 90 files, and I'm guessing this is for a connected reason. If it's not I'll post a new question about it.

Thanks for any help!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gedit Edit question
Assignee:
No assignee Edit question
Solved by:
Wagner Macedo
Solved:
Last query:
Last reply:
Revision history for this message
Best Wagner Macedo (wagnerluis1982) said :
#1

I don't know Fortran, but if all the Fortran's keywords can work with any case, you can edit the file "/usr/share/gtksourceview-2.0/language-specs/fortran.lang" (this file rules fortran syntax highlighting) adding th code <default-regex-options case-sensitive="false"/> after '<styles>' section and before <definition> as follows:

  <styles>
    <style id="comment" _name="Comment" map-to="def:comment"/>
    <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/>
    <style id="keyword" _name="Keyword" map-to="def:keyword"/>
    <style id="base-n-integer" _name="Base-N Integer" map-to="def:base-n-integer"/>
    <style id="decimal" _name="Decimal" map-to="def:decimal"/>
    <style id="type" _name="Data Type" map-to="def:type"/>
  </styles>

  <default-regex-options case-sensitive="false"/>

  <definitions>

Revision history for this message
Leperous (scabin) said :
#2

Thanks wagnerluis1982, that solved my question.

Revision history for this message
Leperous (scabin) said :
#3

Yeah that was the ticket, thanks.