As a long-time TextMate user I've really been enjoying using the new TextMate alpha. There is one feature from 1.5 that I sorely miss -- or at least, can't see how to replicate in v2.
I've checked the FAQ and mailing list but can't see if this was covered before. Apologies if it has been.
I often use quite complex regexes on large files and I want to see what result my replace has had before moving on to the next match.
In v1.5 you did this by clicking "Replace" -- this enabled you to see the result of your substitution (and back out of it if needed). You then clicked "Find" to move to the next match, and so on.
Now however I only see a "Replace and Find" which means I have to remember the line number of the replace then manually scroll back to see if my regex did what I expected (or not).
Is there a new way of doing this? If so, it's not obvious to me.
Many thanks,
Donald
If you do "find all" or find in selection you get a list of all the found items. click in the replace box and you see list of all the "what it will look like then" lines
t
On 26 Jun 2013, at 11:39, "Donald I. Macdonald" donald_i@madasafish.com wrote:
As a long-time TextMate user I've really been enjoying using the new TextMate alpha. There is one feature from 1.5 that I sorely miss -- or at least, can't see how to replicate in v2.
I've checked the FAQ and mailing list but can't see if this was covered before. Apologies if it has been.
I often use quite complex regexes on large files and I want to see what result my replace has had before moving on to the next match.
In v1.5 you did this by clicking "Replace" -- this enabled you to see the result of your substitution (and back out of it if needed). You then clicked "Find" to move to the next match, and so on.
Now however I only see a "Replace and Find" which means I have to remember the line number of the replace then manually scroll back to see if my regex did what I expected (or not).
Is there a new way of doing this? If so, it's not obvious to me.
Many thanks,
Donald
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Thanks, I appreciate the tip, and it was of some help to me.
However I still feel (though I accept I may be in the minority) it is a backward step in usability. Even if the old "replace" button would appear when a modifier key was pressed (as "replace in selection" used to work in TextMate 1) that would satisfy me. This is not a complaint exactly, just my two cents as to what works for me.
As a side issue I noticed that the replace function occasionally matched a regex, but then replaced it with the unmodified string in the replace box, complete with back-references as literal characters. A simple ctrl-z and a repeat of the search fixed the problem both times.
Thanks again,
Donald
On 26 Jun 2013, at 11:10, Tim Bates timothy.c.bates@gmail.com wrote:
If you do "find all" or find in selection you get a list of all the found items. click in the replace box and you see list of all the "what it will look like then" lines
t
On 26 Jun 2013, at 11:39, "Donald I. Macdonald" donald_i@madasafish.com wrote:
As a long-time TextMate user I've really been enjoying using the new TextMate alpha. There is one feature from 1.5 that I sorely miss -- or at least, can't see how to replicate in v2.
I've checked the FAQ and mailing list but can't see if this was covered before. Apologies if it has been.
I often use quite complex regexes on large files and I want to see what result my replace has had before moving on to the next match.
In v1.5 you did this by clicking "Replace" -- this enabled you to see the result of your substitution (and back out of it if needed). You then clicked "Find" to move to the next match, and so on.
Now however I only see a "Replace and Find" which means I have to remember the line number of the replace then manually scroll back to see if my regex did what I expected (or not).
Is there a new way of doing this? If so, it's not obvious to me.
Many thanks,
Donald
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 2 Jul 2013, at 11:58, Donald I Macdonald wrote:
However I still feel (though I accept I may be in the minority) it is a backward step in usability. Even if the old "replace" button would appear when a modifier key was pressed (as "replace in selection" used to work in TextMate 1) that would satisfy me. This is not a complaint exactly, just my two cents as to what works for me.
Your original letter mentioned that you would use the Replace for testing what the result would be, and thus Replace and Find wouldn’t work, because focus would move to the next match.
This made me think that perhaps instead of your two-step process with a potential undo, would it be useful if Find Next (⌘G) would show a tool tip with a replacement preview? Probably only when the search was for a regular expression with captures.
Btw: the functionality of TextMate 1’s replace button still exist but is unbound. You can add a custom key binding to the ‘replace:’ action. I’ll look into adding menu item and/or button for it in upcoming build.
As a side issue I noticed that the replace function occasionally matched a regex, but then replaced it with the unmodified string in the replace box, complete with back-references as literal characters. A simple ctrl-z and a repeat of the search fixed the problem both times.
When you do a regular expression search, it adds the captures (from the search) to the replace clipboard, so if the replace clipboard has been changed since the search and subsequent replace, it would insert the replacement string without expanding the captures.
If you can figure out what triggers it, that would be useful. It could be something like switching to another program, or maybe bringing up find dialog and making changes.
Thanks for taking the time to reply. I will post to the list again if I can reliably reproduce the replace bug issue I noted.
In the meantime, knowing the replace functionality can be bound to a key is a huge help. Much appreciated!
On 3 Jul 2013, at 01:36, "Allan Odgaard" mailinglist@textmate.org wrote:
Btw: the functionality of TextMate 1’s replace button still exist but is unbound. You can add a custom key binding to the ‘replace:’ action. I’ll look into adding menu item and/or button for it in upcoming build.