<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Thank you for your clarification, and I’m sorry for my command/control confusion (how embarrassing!).</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I had no idea that Control + T would respect a hyphen as a separator. That is awesome and is a perfect example to my use case, so thanks for that.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">And that would settle it, except you peaked my interest with your last sentence: </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><blockquote type="cite" class="clean_bq"> Filter Through Command (which is really just an ad hoc command).</blockquote></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Would you mind sharing the code for that command, or point me to a similar one?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Thanks much,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div> <div id="bloop_sign_1430751344406558976" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">Graham P Heath<br><br></div></div> <br><p style="color:#000;">On May 3, 2015 at 10:31:51 AM, Allan Odgaard (<a href="mailto:mailinglist@textmate.org">mailinglist@textmate.org</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>On 29 Apr 2015, at 23:23, Graham P Heath wrote:<br><br>> Is it possible for a bundle command to accept a single selection and <br>> return multiple selections (or just carets)? <br><br>It can return a snippet where subsets can be selected, but I don’t <br>think this is useful for your example.<br><br>> Here’s an example (brackets indicate selection, | is a caret );<br>> […]<br>> Then I’d press command T to switch from "dark-theme" to <br>> "theme-dark".<br><br>I am not sure I follow your example. If you mean control T (rather than <br>command T) then this will transform “dark-theme” into <br>“theme-dark” if the entire thing is selected, so here there is no <br>need to “split” the selection into left/right carets, or to select <br>only the first word (on the contrary).<br><br>Though when there are multiple selections, control T changes from acting <br>on each selection, to acting on all selections, and will transpose them <br>(swap them around).<br><br>So I think I understand what feature you want, but the example isn’t <br>the best, and also, if you get multiple carets, they sort of all act on <br>the actions you do, e.g. move left/right etc., so “splitting” a <br>selection into a left/right caret would be very hard to subsequently <br>work with, as I don’t think there are many actions that would be able <br>follow this.<br><br>> Im not sure what the logic would be in the bundle, my use would be <br>> served by simply returning the caret at the beginning and end of my <br>> selection (then command + w to select the word).<br><br>Here I assume you mean control W. The end result could be achieved by <br>selecting the “dark-theme” instances, then do a (regexp) “Find <br>All” for \b\w+\b, although I don’t know step would follow this; if <br>the goal is to swap them around, it might be simplest to do a search and <br>replace, though leaving out the find dialog, I would probably have <br>selected “dark-” and used control W to select consecutive matches, <br>then ⌘X, ⌥→, -, ⌘V, ⌫ to “swap” the order of all the <br>instances.<br><br>> I’m also curious how Filter Through Command’s behavior could be <br>> reproduced in a bundle command, where the commands results are <br>> distributed to each line.<br><br>Do you mean “each caret” (rather than “each line”)?<br><br>If the input/output option of the command is selection/replace input, <br>then it should act the same as Filter Through Command (which is really <br>just an ad hoc command).<br><br>_______________________________________________<br>textmate mailing list<br>textmate@lists.macromates.com<br>http://lists.macromates.com/listinfo/textmate</div></div></span></blockquote></body></html>