我正在尝试从 Gedit 更改突出显示文件。我修改了文件 /usr/share/gtksourceview-3.0/language-specs/fortran.lang 因为我想改变编辑器将语句作为注释的情况。我遇到的问题是,当我选择新的突出显示方案时,没有任何突出显示,它只是纯文本。
文件 fortran.lang 是用 su 权限打开的,我只是将所有内容复制粘贴到一个新的 Gedit 文件中,然后将其保存为同一文件夹中的 fortran_enhanced.lang。我对原始文件所做的更改如下:
原始 fortran.lang 文件:
<language id="fortran" _name="Fortran 95" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-fortran</property>
<property name="globs">*.f;*.f90;*.f95;*.for</property>
<property name="line-comment-start">!</property>
</metadata>
<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="intrinsic" _name="Intrinsic function" map-to="def:builtin"/>
<style id="boz-literal" _name="BOZ Literal" 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>
<!-- Note: contains an hack to avoid considering ^COMMON a comment -->
<context …Run Code Online (Sandbox Code Playgroud)