Arrrg! Trying to understand the format of bundle definitions.
Trouble number one: I'm trying to change the type of comments used for plain text types. I've added the following to the patterns array of the "Plain Text" language definition:
{ name = 'comment.line.right-angle-bracket.text'; match = '>.*$'; }
And nothing happens. I then tried creating a new bundle for a new type of document ("Test Doc") and setting the patterns array to only the above. Nothing.
What am I doing wrong?
Thanks if you can help!
Quinn
On Feb 17, 2006, at 1:15 AM, Quinn Comendant wrote:
What am I doing wrong?
It worked fine when I tried it. Did you remember to press the "Test" button, to make TextMate process the changes you made?
Did you edit the language file in the bundle editor, or did you edit the .plist file directly? If you did the latter, I think you need to restart TextMate, and in general don't do the latter. :)
Btw, you might want to add a ^ at the beginning of the matched regexp, if you want it t only match > at the beginning of a line, i.e.: { name = 'comment.line.right-angle-bracket.text'; match = '^>.*$'; }
Thanks if you can help!
Quinn
Haris
What am I doing wrong?
It worked fine when I tried it. Did you remember to press the "Test" button, to make TextMate process the changes you made?
It still doesn't work for me. I edit in the bundle editor, click test (no errors), close bundle editor, open new .txt file, try commenting a line and I get a # instead of a >. Here is the first few lines of my Text -> Plain Text language bundle (the grey dot with the L):
{ scopeName = 'text.plain'; fileTypes = ( 'txt' ); patterns = ( { name = 'comment.line.right-angle-bracket.text'; match = '^>.*$'; }, { name = 'declaration.bullet-point.strong'; match = '^\s*ยท.*$'; }, ---snip---
Any other ideas? Is there a debug log for the parsing and application of bundles components?
Thanks, Quinn
On Feb 17, 2006, at 3:59 PM, Quinn Comendant wrote:
It still doesn't work for me. I edit in the bundle editor, click test (no errors), close bundle editor, open new .txt file, try commenting a line and I get a # instead of a >. Here is the first few lines of my Text -> Plain Text language bundle (the grey dot with the L):
Ah that is a different question. I thought you wanted lines starting with > to be considered comments, and the above would do that. The comment/uncomment command is a command in the source bundle, and it uses the values of the scope specific variables TM_COMMENT_START and friends for setting the proper behavior. Take a look at the "Miscellaneous" preference file in the LaTeX bundle for example to get an idea. It has the following:
shellVariables = ( { name = 'TM_COMMENT_START'; value = '%'; }, { name = 'TM_COMMENT_END'; value = ''; }, { name = 'TM_COMMENT_MODE'; value = 'line'; }, );
You can look at other bundles too. you'd probably just want to add something like this to a new preference item in the text bundle, with scope text.plain
Thanks, Quinn
Haris