Sample Header Ad - 728x90

Custom syntax highlighting misbehaving in gedit

1 vote
0 answers
185 views
For gedit, I'm creating a custom syntax highlighter for a markup-like language that I created to accomplish some natural language manipulation stuff, so I thought I'd get started with the simple keywords, seeing as I don't need to come up with regexes for them. I've defined the following in the XML:
text/x-c;text/x-csrc;image/x-xpixmap
    *.foo
  

  
    
    
  

  

    
      ref
      alt
      pos
      num
    

    
      #
      $
      @
      [
      ]
      :
      =
      :?
      &
The syntax does highlight, but only on some odd conditions. Specifically, any keyword in the operators context must be both preceded by and followed by a non-keyword character, lest it will fail to highlight. Screencap Should I be using a regex for these or did I just botch the XML? Also, why do the members keywords highlight without issue?
Asked by Alex Clough (111 rep)
Aug 2, 2016, 01:16 AM
Last activity: Feb 15, 2024, 04:54 PM