2012-10-16 35 views
1

有誰知道是否有方法在GtkSourceView 3 XML語言文件中指定重疊模式?例如,在下面的文本,有沒有辦法來突出「一些文字......」 和一種顏色的之間「一些文字......」 酒吧巴茲之間另一種顏色?這裏的問題是酒吧是一個上下文的結尾,也是另一個的開始,這意味着上下文將永遠不會應用。在GtkSourceView中使用重疊模式

foo 
some text... 
bar 
some more text... 
baz 

回答

0

我找到了解決方法。所述酒吧部分可以被包括在FOO部分:

<context id="bar" style-ref="bar" style-inside="true" extend-parent="false"> 
    <start>^bar\b</start> 
</context> 

<context id="foo" style-ref="foo" style-inside="true"> 
    <start>^foo\b</start> 
    <end>^baz\b</end> 
    <include> 
     <context ref="bar"/> 
    </include> 
</context>