So, I'm finally getting to the point that I'm really starting to play around a bit with the automation aspects of TextMate. I think that I found a bug, but I want to confirm.
I created a macro, which through the course of its steps utilizes a snippet. The snippet has default values, which I'm also using, because it's a very repetitive task. The idea behind this, is that when I got to a different spot in the code that I'm working on, I would change the snippet defaults and keep using the macro.
What appears to be happening instead, is the old default values are used instead of the new ones. When I use the snippet manually, the new values I put in are still used. Is this a bug, or is my expectation wrong?
(this is on b5 btw)
I know it's bad to reply to myself, but I believe I found my answer. It looks like the macro editor encodes the snippet into the macro itself, not really using the global snippets. While this is somewhat confusing, it does appear to provide me with a workaround.
On Apr 15, 2005, at 5:51 AM, Robert M.Zigweid wrote:
So, I'm finally getting to the point that I'm really starting to play around a bit with the automation aspects of TextMate. I think that I found a bug, but I want to confirm.
I created a macro, which through the course of its steps utilizes a snippet. The snippet has default values, which I'm also using, because it's a very repetitive task. The idea behind this, is that when I got to a different spot in the code that I'm working on, I would change the snippet defaults and keep using the macro.
What appears to be happening instead, is the old default values are used instead of the new ones. When I use the snippet manually, the new values I put in are still used. Is this a bug, or is my expectation wrong?
(this is on b5 btw)
Robert M. Zigweid rzigweid@zigweid.net http://rzigweid.zigweid.net ______________________________________________________________________ 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
It's not a bug, it's a feature. It makes sure your macro doesn't break when you modify or delete the snippet.
TM help on macros mentions this behaviour for macros using other macros:
The editing operations recorded are:
- Executing another macro (the entire macro you execute is copied, so
if you later change it, it will not affect the one you recorded)
Cheers, -Ralph.
On 15.04.2005, at 11:59, Robert M.Zigweid wrote:
I know it's bad to reply to myself, but I believe I found my answer. It looks like the macro editor encodes the snippet into the macro itself, not really using the global snippets. While this is somewhat confusing, it does appear to provide me with a workaround.
On Apr 15, 2005, at 5:51 AM, Robert M.Zigweid wrote:
So, I'm finally getting to the point that I'm really starting to play around a bit with the automation aspects of TextMate. I think that I found a bug, but I want to confirm.
I created a macro, which through the course of its steps utilizes a snippet. The snippet has default values, which I'm also using, because it's a very repetitive task. The idea behind this, is that when I got to a different spot in the code that I'm working on, I would change the snippet defaults and keep using the macro.
What appears to be happening instead, is the old default values are used instead of the new ones. When I use the snippet manually, the new values I put in are still used. Is this a bug, or is my expectation wrong?
On 15-04-2005, at 12:09, Ralph Pöllath wrote:
It's not a bug, it's a feature. It makes sure your macro doesn't break when you modify or delete the snippet.
Sometimes though, as also indicated by Ralph's initial mail, it can be quite useful to be able to modify a macro/snippet that another macro uses. Maybe a toggle option? Hmm.
On Apr 15, 2005, at 11:59, Robert M.Zigweid wrote:
I know it's bad to reply to myself, but I believe I found my answer. It looks like the macro editor encodes the snippet into the macro itself, not really using the global snippets. While this is somewhat confusing, it does appear to provide me with a workaround.
Yes -- as Ralph mentions, this is a feature, because you could lose/change etc. the original macro/command/snippet that was used in the macro and/or you could send your macro to a friend who is w/o the dependencies. And of course, the macro could easily break if you change the dependencies.
If you do want a dynamic snippet in your macro, you can call out to the shell and use a variable. E.g. inserting this snippet: “this is ${0:`printenv MY_DEFAULT_VALUE`}!” allows you to change the result of the snippet by going to Preferences / Advanced and setting a value for the MY_DEFAULT_VALUE variable (or set the variable in one of the files sourced by bash).