Problem with modified styling for Hypertext lexer

From: phayz <russelldicken....at.gmail.com>
Date: Wed, 15 Dec 2010 14:01:02 -0800 (PST)

Since I first started using Textadept I have made slight changes to
the styles applied to Hypertext files. Specifically, the atttribute
and entity elements deliberately have the style "style_nothing"
applied to them. I have been changing these so that style_entity
appears in bold and purple, and style_attribute appears in bold and
green.

I am again making these changes and I find that I can't get the
desired effect. I make a copy of "hypertext.lua" from the TA lexers
folder and put it into .textadept\lexers. I then modify my copy of
hypertext.lua so that my desired styles are applied, specifically:

Extract from personal hypertext.lua

_tokenstyles = {
  { 'tag', l.style_tag },
  { 'element', l.style_tag },
  { 'attribute', l.style_attribute..{ bold = true } },
  { 'entity', l.style_entity..{ bold = true } },
  { 'doctype', l.style_keyword },

I then check and, if necessary, edit my theme's lexer.lua so the these
styles have the appropriate colours applied to them, specifically:

Extract from my theme's lexer.lua:

style_entity = style { fore = colors.purple }
style_attribute = style { fore = colors.green }

When I restart Textadept after making these changes, I open a
Hypertext file and the visual styles are not applied at all.

In trying to work out what's gone wrong, I edit my personal copy of
hypertext.lua and change the 'attribute' styling back to its original:

  { 'attribute', l.style_nothing..{ bold = true } },

With this change made, everything works as expected. My example
Hypertext file (Textadept's 1_Introduction.html) is correctly styled.
Even 'attribute' elements are styled as per my theme, in that they
appear in bold, and 'entity' elements (for example, &amp;) also appear
correctly in bold and purple. If I change just one part of my
hypertext.lua file, to have 'attribute' elements appear in green, the
original problem occurs, in that the Hypertext file doesn't have any
styling applied to it at all. I just can't see what's going wrong.
Received on Wed 15 Dec 2010 - 17:01:02 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:57:31 EST