Hi!
I wonder if I am the only person that would love to see nested snippets. Apparently, at the moment, snippets are processed by regular expression matching, which rules out nesting of placeholders. But wouldn't it be great if one could do something like this (that's for Prolog code):
findall(${1:X}, ${2:member(${1:X}, $4)}, ${1:X}s)
If you deleted $2, of course, the placeholders inside it would not be activated any more.
And sorry if this has already been discussed, but I couldn't find any references to this particular subject.
Ole
On Jan 26, 2005, at 9:53 AM, Jan-Ole Esleben wrote:
I wonder if I am the only person that would love to see nested snippets.
Nope, I wanted it to. And actually I thought it was possible for what I was trying to do. I just wanted to use an existing snippet when inside the placeholder of another snippet. So if I expand a snippet with tab, then start typing a new snippet in the placeholder, my next tab would expand that new snippet instead of moving to the next placeholder of the first. I might not be explaining this properly...
Know what I mean?
- Justin
Yeah, I know what you mean, but it's not really the same thing. It doesn't allow for mirroring a variable from the outer snippet, for example.
Ole
On Wed, 26 Jan 2005 10:09:39 -0500, Justin Blake justin@blaix.com wrote:
On Jan 26, 2005, at 9:53 AM, Jan-Ole Esleben wrote:
I wonder if I am the only person that would love to see nested snippets.
Nope, I wanted it to. And actually I thought it was possible for what I was trying to do. I just wanted to use an existing snippet when inside the placeholder of another snippet. So if I expand a snippet with tab, then start typing a new snippet in the placeholder, my next tab would expand that new snippet instead of moving to the next placeholder of the first. I might not be explaining this properly...
Know what I mean?
- Justin
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
Yeah I know it's not the same thing, sorry. I was unclear. What I described was an additional feature I would like to see.
On Jan 26, 2005, at 10:25 AM, Jan-Ole Esleben wrote:
Yeah, I know what you mean, but it's not really the same thing. It doesn't allow for mirroring a variable from the outer snippet, for example.
Ole
On Wed, 26 Jan 2005 10:09:39 -0500, Justin Blake justin@blaix.com wrote:
On Jan 26, 2005, at 9:53 AM, Jan-Ole Esleben wrote:
I wonder if I am the only person that would love to see nested snippets.
Nope, I wanted it to. And actually I thought it was possible for what I was trying to do. I just wanted to use an existing snippet when inside the placeholder of another snippet. So if I expand a snippet with tab, then start typing a new snippet in the placeholder, my next tab would expand that new snippet instead of moving to the next placeholder of the first. I might not be explaining this properly...
Know what I mean?
- Justin
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
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
On Jan 26, 2005, at 15:53, Jan-Ole Esleben wrote:
Apparently, at the moment, snippets are processed by regular expression matching
No they are not, but anyway... ;)
[...] wouldn't it be great if one could do something like this (that's for Prolog code):
findall(${1:X}, ${2:member(${1:X}, $4)}, ${1:X}s)
If you deleted $2, of course, the placeholders inside it would not be activated any more.
What if you delete $2 and back-tab to $1?
The thing Justin Blake wants (about starting new snippets inside snippets) is on the to-do, when I get to that, I'll consider this one as well. There is some improvements I'd like to make, for example I'd like to be able to filter a mirror-typing (e.g. the “wrap in tag” snippet should not show tag arguments for the close tag), so I may end up with a more general system than currently (which should be good :) ).