新しい言語を gtksourceview (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 エンティティとバックスラッシュ (\) を使用してみましたが、機能しません。
誰かが何が問題なのか知っていますか?
ありがとう。