Use double line feed as <end>-element in GtkSourceView

68 Views Asked by At

I'm working on a language definition for GtkSourceView. I've got an element which starts with a "@LI:" and ends with a double line feed. The first line should get a different style, then the rest of the element another style.

My problem right now is, that I can't find a [...] definition, which matches the double line feed at the end of the segment. Something like [\r\n] doesn't work. The element ends at the end of the file.

Here's an example of my markup I work with:

@L:Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

@LI:
Nulla consequat massa quis enim.
Donec pede justo, fringilla vel.
vulputate eget, arcu.

@L:In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. 

And this is the part of my .lang file.

[...]
<style id="li" name="Listing" map-to="def:identifier"/>
<style id="kt" name="Kastentitel" map-to="def:type"/>
[...]    
<context id="li" style-ref="li">
  <start>@LI:</start>
  <end>[\r\n]{2,}</end>
  <include>
    <context sub-pattern="0" where="start" style-ref="kt"/>
    <context sub-pattern="0" where="end" style-ref="kt"/>
    <context ref="kt"/>
  </include>
</context>

Thanks for your help!

0

There are 0 best solutions below