[TxMt] Re: Replace without finding

Allan Odgaard mailinglist at textmate.org
Wed Jul 3 00:36:38 UTC 2013


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.


More information about the textmate mailing list