[TxMt] Re: Find-previous in TM2 macro

Allan Odgaard mailinglist at textmate.org
Sun Jun 9 14:18:01 UTC 2013


On Jun 8, 2013, at 1:10, Max Weiss <30f0fn at gmail.com> wrote:

> Now, when I imported these macros into Textmate 2, the jump-forward macro 
> works fine.  But, the jump-backward macro behaves like the jump-forward 
> macro. […] If anybody could suggest an explanation or remedy I'd appreciate it!  

The “search backward” macro action was treated as a forward search. I have corrected that in a test build that you can obtain by holding option while clicking Check Now in Preferences → Software Update.

You may however need to modify the macro as shown below to work when already at a start of a sentence. This has to do with how “find previous” will now allow the found range to extend to the right of the caret, which 1.x didn’t do. I don’t like this behavior, but it’s presently handled by the regexp library, so it might take a while before I get around to changing it.

I btw simplified the regular expression, it should still do the same.

   (
      {  command = 'moveLeft:'; },
      {  command = 'moveLeft:'; },
      {  argument = {
            action = 'findPrevious';
            findString = '[?.!][''")}\]]*\s+|\n\s';
            regularExpression = :true;
         };
         command = 'findWithOptions:';
      },
      {  command = 'moveRight:'; },
   )



More information about the textmate mailing list