我遇到了一个问题,需要在gtksourceview中添加新语言(由gedit使用)。为gtksourceview添加一种新语言(Django的gedit模板语言)
我想补充的Django的模板语言的东西不起作用:
我不能够让%}停止语法着色。
这里是一个片段:
<context id="dtl-block" end-at-line-end="true">
<start>{%</start>
<end>%}</end>
<include>
<context sub-pattern="0" where="start" style-ref="preprocessor"/>
<context sub-pattern="0" where="end" style-ref="preprocessor"/>
<context ref="string"/>
<context ref="chaine"/>
<context ref="keywords"/>
<context ref="filters"/>
<context ref="operators"/>
<context ref="variable"/>
</include>
</context>
这个片段的颜色正确我的代码,但它不会在%}停止。 它继续着色后%,所以有什么问题。
我做了这是工作的一个片段:
<context id="variable-block" end-at-line-end="true">
<start>{{</start>
<end>}}</end>
<include>
<context sub-pattern="0" where="start" style-ref="preprocessor"/>
<context sub-pattern="0" where="end" style-ref="preprocessor"/>
<context ref="variable"/>
</include>
</context>
它工作得很好。
{{和}}作品,但%}没有。
我试过用html实体和反斜杠(\),它不起作用。
有人知道可能是什么问题吗?
谢谢。
如果您可以在某处共享您的gtksourceview语言语法文件(或者您已经做过?),那将会很好。 – JanC 2010-08-24 06:30:07
是的,我确实分享过。 您可以在此(法语)主题的第一篇文章中找到它: http://www.siteduzero.com/forum-83-541444-p1-utilisez-gedit-pour-vos-projets-django.html 你必须点击“(cliquez pour afficher)”来查看它。 解释以法语说明(如果需要,请使用Google翻译)。 我很高兴你觉得它有用。 – antoyo 2010-08-29 14:06:33