can anyone explain why this definition in the perl language bundle includes the newline as part of the comment?
line_comment = { name = 'comment.line.number-sign.perl'; match = '#.*$\n?'; };
it causes weird things in the mason bundle i use, where if a line of perl includes a comment, textmate assumes the following line is also perl, when it frequently is not.
% if ( $something ) { # something is up <p>hi, something is up!</p> textmate thinks this line is perl and the syntax highlighting is wrong % }
if i want to change the line_comment pattern, but not miss any future updates that might come with the perl bundle, what is the right way to go about it?
--- michael reece :: software engineer :: mreece@vinq.com
On 29/7/2006, at 1:00, Michael Reece wrote:
can anyone explain why this definition in the perl language bundle includes the newline as part of the comment?
So that when you’re at the end of the line, you’re still in the single-line comment scope, e.g. for overloading of the enter key in line comments or improved visual styling (which would make the background color extend to the right window border.)
[...] if i want to change the line_comment pattern, but not miss any future updates that might come with the perl bundle, what is the right way to go about it?
In your Mason language grammar, before you include source.perl, put your own comment rule there which doesn’t include the newline -- that one will take precedence over the one you include.
can you give an example how that would work? i assume i would modify this block,
{ name = 'source.perl.mason.line'; begin = '^(%)'; end = '$'; beginCaptures = { 1 = { name = 'keyword.control'; }; }; patterns = ( { include = 'source.perl'; } ); },
but cannot figure out the proper syntax or the right boundaries to copy/paste from the perl language bundle.
repository = { line_comment = { name = 'comment.line.number-sign.perl'; match = '#.*$\n?'; }; [..snip..] };
is it not possible to copy/overload the single item from source.perl's repository?
On Jul 28, 2006, at 4:49 PM, Allan Odgaard wrote:
On 29/7/2006, at 1:00, Michael Reece wrote:
can anyone explain why this definition in the perl language bundle includes the newline as part of the comment?
So that when you’re at the end of the line, you’re still in the single-line comment scope, e.g. for overloading of the enter key in line comments or improved visual styling (which would make the background color extend to the right window border.)
[...] if i want to change the line_comment pattern, but not miss any future updates that might come with the perl bundle, what is the right way to go about it?
In your Mason language grammar, before you include source.perl, put your own comment rule there which doesn’t include the newline -- that one will take precedence over the one you include.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
--- michael reece :: software engineer :: mreece@vinq.com
On 29/7/2006, at 2:46, Michael Reece wrote:
can you give an example how that would work? i assume i would modify this block,
{ name = 'source.perl.mason.line'; begin = '^(%)'; end = '$'; beginCaptures = { 1 = { name = 'keyword.control'; }; }; patterns = ( { include = 'source.perl'; } ); },
That should be:
{ name = 'source.perl.mason.line'; begin = '^(%)'; end = '$'; beginCaptures = { 1 = { name = 'keyword.control.mason'; }; }; patterns = ( { name = 'comment.line.number-sign.perl'; match = '#.*$'; }; { include = 'source.perl'; } ); },