[TextMate] Ruby syntax coloring glitch
Rich Barton
richbarton at mac.com
Thu Oct 14 10:49:03 UTC 2004
On 14 Oct 2004, at 11:00, Jeroen wrote:
> Ollivier Robert wrote:
>> I just noticed that the coloration for "def" is a bit overeager, see
>> attached snapshot. Look for "def_port".
>
> This is not just def in Ruby. It's all highlighting based on keywords.
> Keywords preceeded by characters works okay, but keywords followed by
> anything is still highlighted (if there is no other highlighting
> active).
I've just done a few tests (in beta 3), and it seems this problem
*only* affects the 'def' keyword. I think the cause of this is the
following lines in the syntax definition file:
{ name = "Method With Arguments"; match =
"^\\s*(def)\\s*([.a-zA-Z_?!]+)\\s*\\((.*)\\)";
"foregroundColor[1]" = "#CC7833";
"fontStyle[3]" = ( italic );
},
{ name = "Method Without Arguments"; match =
"^\\s*(def)\\s*([.a-zA-Z_?!]+)";
"foregroundColor[1]" = "#CC7833";
},
I think the "\\s*" in the match option should be "\\s+" after "def" (or
the \< and \> anchors should be used), as there should always be
whitespace after def, right?
> IMO keywords should only be highlighted if they are not followed by
> alphanumeric characters or '_'.
This seems to be the existing behaviour to me.
Rich Barton
More information about the textmate
mailing list