I'm not sure if there is really a way to fix this or not, given the way that the snippets work. But the tag snippet (activated by default with <-tab) appears to have a bug.
Actually it may be just a misconception on my part, but the problem is, when I activate the snippet with <-tab, the general flow for me is to type in the snippet name, and then the attributes, then tab to get at the Text Node portion of the tag. The problem is that the attributes show up in the closing tag too. I'm not sure if this is fixable or not based upon the way that snippets work. But it sure would be convenient if the attributes didn't show up in the closing tag too.
Regards,
Robert M. Zigweid
On Apr 10, 2005, at 18:22, Robert M.Zigweid wrote:
Actually it may be just a misconception on my part, but the problem is, when I activate the snippet with <-tab, the general flow for me is to type in the snippet name, and then the attributes, then tab to get at the Text Node portion of the tag. The problem is that the attributes show up in the closing tag too. I'm not sure if this is fixable or not based upon the way that snippets work. But it sure would be convenient if the attributes didn't show up in the closing tag too.
Not really fixable ATM. You could change the snippet to: <$1 $2>$0</$1>. You'd then need to tab to the arguments part rather than use space. I do plan in the future to allow something like /s/ptrn/replacement/ to be added to the mirror (e.g. “<$1>$0</${1/s/(\w+*).*/$1/}>”), so that instead of an exact mirror, one can do a regex-replace on the text entered. This would then also allow for snippets where e.g. getter and setter methods use different case for the attribute name (as in obj-c/cocoa).
Actually, I consider this to be an adequate workaround. I've modified my version of the snippet to do this. Long and short, the snippet should considier attributes. That workaround solves the issue. On Apr 10, 2005, at 12:37 PM, Allan Odgaard wrote:
On Apr 10, 2005, at 18:22, Robert M.Zigweid wrote:
Actually it may be just a misconception on my part, but the problem is, when I activate the snippet with <-tab, the general flow for me is to type in the snippet name, and then the attributes, then tab to get at the Text Node portion of the tag. The problem is that the attributes show up in the closing tag too. I'm not sure if this is fixable or not based upon the way that snippets work. But it sure would be convenient if the attributes didn't show up in the closing tag too.
Not really fixable ATM. You could change the snippet to: <$1 $2>$0</$1>. You'd then need to tab to the arguments part rather than use space. I do plan in the future to allow something like /s/ptrn/replacement/ to be added to the mirror (e.g. “<$1>$0</${1/s/(\w+*).*/$1/}>”), so that instead of an exact mirror, one can do a regex-replace on the text entered. This would then also allow for snippets where e.g. getter and setter methods use different case for the attribute name (as in obj-c/cocoa).
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