gedit的语法高亮与gtksourceview的逆向引用子模式? [英] Gedit syntax-highlighting with gtksourceview for backreferencing sub-patterns?
本文介绍了gedit的语法高亮与gtksourceview的逆向引用子模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面将重点介绍超时,第二行,但不会再有高亮显示。是否gtksourceview支持的子模式,将整个文件中匹配所有实例某种反向引用的?
/usr/share/gtksourceview-2.0/language-specs/c.lang
<上下文ID =结构的风格-REF =结构>
<&比赛GT; \\ bstruct \\ b \\ S \\ W + \\ S(\\ w +)LT; /匹配>
<&包括GT;
&所述;上下文子图案=1样式-REF =structname/>
< / - 包括GT;
< /背景>
INT纳秒;
timeval结构超时;
timeout.tv_sec = 1;
timeout.tv_usec = 0;setsockopt的(NS,SOL_SOCKET,SO_SNDTIMEO,和放大器;超时的sizeof(超时));
setsockopt的(NS,SOL_SOCKET,SO_RCVTIMEO,和放大器;超时的sizeof(超时));
解决方案
显然,的请求的功能目前还不支持。
The following will highlight "timeout" on the second line but will not highlight it ever again. Does gtksourceview support some sort of backreference on the "sub-pattern" that will match all instances throughout the file ?
/usr/share/gtksourceview-2.0/language-specs/c.lang
<context id="struct" style-ref="struct">
<match>\bstruct\b\s\w+\s(\w+)</match>
<include>
<context sub-pattern="1" style-ref="structname"/>
</include>
</context>
int ns;
struct timeval timeout;
timeout.tv_sec = 1;
timeout.tv_usec = 0;
setsockopt(ns, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
setsockopt(ns, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
解决方案
Apparently, the requested functionality is not supported at the moment.
这篇关于gedit的语法高亮与gtksourceview的逆向引用子模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文