以下将在第二行突出显示“超时”,但不会再次突出显示它。gtksourceview 是否支持“子模式”上的某种反向引用,以匹配整个文件中的所有实例?
/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));