Re: [gedit-list] GtkSourceMarker API



Il giorno mar, 28/08/2007 alle 22.40 +0200, August Karlstrom ha scritto:
> Don't know if it is related to GtkSourceMarker but what I really miss 
> when it comes to the .lang files is the ability to specify a 
> subexpression of a regular expression to be highlighted.
> 

This is possible in GtkSourceView 2.

Here is an example from c.lang:

<context id="include" style-ref="preprocessor">
  <match extended="true">
    ^\s*#\s*
    (include|import)\s*
    (".*?"|&lt;.*&gt;)
  </match>
  <include>
    <context id="included-file" sub-pattern="2" style-ref="included-file"/>
  </include>
</context>

the snippet above is meant to match #include "foo.h", so it matches '#'
followed by 'include' followed by space followed by a quoted string.
It then specifies that the second sub-pattern in the match, that is the
second group delimited by ( and ) should be styled with the
"included-file" style.

ciao
	Paolo





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]