What do people think about adding Cmd-Shift-J to do what Cmd-J does but only on entire words? For example, I just edited a method where I wanted to replace window with windowSpec and later window with systemWindow. Using Cmd-J wasn't;t an option because the string window occurred as a prefix in may places. But a Cmd-J that respected word boundaries and only replaced whole words matching the search & replace would have worked nicely and be easy to remember.
_,,,^..^,,,_ best, Eliot |
Hi Eliot,
Cmd-Shift-J (aka Shift-Alt-J) does the same as Cmd-J, but replaces all occurrences of the selection. It was recently messed up a bit (probably in 5.2, so try an 5.1 image to see how it used to work), so now you have to press it twice, and sometimes it corrupts the replacement text. When I want selective replacements, I press Cmd-J to replace the current selection, and press Cmd-G to skip it. It's not exactly what you want, but solves the same problem. Levente On Mon, 23 Dec 2019, Eliot Miranda wrote: > What do people think about adding Cmd-Shift-J to do what Cmd-J does but only on entire words? For example, I just edited a method where I wanted to replace window with windowSpec and later window with systemWindow. Using > Cmd-J wasn't;t an option because the string window occurred as a prefix in may places. But a Cmd-J that respected word boundaries and only replaced whole words matching the search & replace would have worked nicely and be > easy to remember. > _,,,^..^,,,_ > best, Eliot > > |
In reply to this post by Eliot Miranda-2
Isn't this a place where the refactoring browser stuff helps a lot? Actually knowing that you want to change a variable named foo to wibble? Assuming of course that that is actually what you are wanting.
> On 2019-12-23, at 2:47 PM, Eliot Miranda <[hidden email]> wrote: > > What do people think about adding Cmd-Shift-J to do what Cmd-J does but only on entire words? For example, I just edited a method where I wanted to replace window with windowSpec and later window with systemWindow. Using Cmd-J wasn't;t an option because the string window occurred as a prefix in may places. But a Cmd-J that respected word boundaries and only replaced whole words matching the search & replace would have worked nicely and be easy to remember. > _,,,^..^,,,_ > best, Eliot > tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- Several nuts over fruitcake minimum. |
Hi Tim, On Mon, Dec 23, 2019 at 5:03 PM tim Rowledge <[hidden email]> wrote: Isn't this a place where the refactoring browser stuff helps a lot? Actually knowing that you want to change a variable named foo to wibble? Assuming of course that that is actually what you are wanting. Sure, but the refactoring browser works on methods that already exist, not on methods one is currently authoring.
_,,,^..^,,,_ best, Eliot |
In reply to this post by Levente Uzonyi
Hi Levente, On Mon, Dec 23, 2019 at 4:58 PM Levente Uzonyi <[hidden email]> wrote: Hi Eliot, Neat. I shall try and get that into my muscle memory. Thanks.
_,,,^..^,,,_ best, Eliot |
In reply to this post by Eliot Miranda-2
> On 2019-12-23, at 5:33 PM, Eliot Miranda <[hidden email]> wrote: > > Hi Tim, > > On Mon, Dec 23, 2019 at 5:03 PM tim Rowledge <[hidden email]> wrote: > Isn't this a place where the refactoring browser stuff helps a lot? Actually knowing that you want to change a variable named foo to wibble? Assuming of course that that is actually what you are wanting. > > Sure, but the refactoring browser works on methods that already exist, not on methods one is currently authoring. > Hmm. Point. So I have to wonder if maybe Shout could help with this a well; after all it's doing some analysis as you type so maybe that could be leveraged? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange Opcodes: FART: Fill Accumulator from Result if True |
Hi Tim, On Mon, Dec 23, 2019 at 5:45 PM tim Rowledge <[hidden email]> wrote:
Hmm, interesting. So one could imagine the interface to the refactored/shout etc being integrated with text editing so that to rename a temp var one simply selected ts it in the declaration within |'s and overtypes it. That would be nice. But how general is the scheme? Does it work for selectors? I doubt it. And so it could just be a clever idea. What Levente points out with Ctrl-J & Ctrl-G is much simpler primitives that compose well are more generally useful. They're more useful as a combo than my ideas for a word-boundary respecting alternative. I don't want to poo poo any ideas though. I'm just saying that I'm happy with Levente's suggestion. tim _,,,^..^,,,_ best, Eliot |
> On 2019-12-23, at 5:56 PM, Eliot Miranda <[hidden email]> wrote: > > > Hmm, interesting. So one could imagine the interface to the refactored/shout etc being integrated with text editing so that to rename a temp var one simply selected ts it in the declaration within |'s and overtypes it. That would be nice. Sometihng like that might be possible. After all Shout has to work out a lot of this to colour things. > But how general is the scheme? Does it work for selectors? I doubt it. No idea. Definitely needs thought by someone into the whole structure of code stuff rather more than I. > And so it could just be a clever idea. What Levente points out with Ctrl-J & Ctrl-G is much simpler primitives that compose well are more generally useful. Yes, but we should remember that we are (very) old farts with huge past investment in thinking of text editing. We laugh at Emacs users (mention not the vi users with their puny abacuses) and their fancy-schmancy macro messing with dead text in boring old files but honestly we're not so far ahead. I'd bet that within a single method context sometihng like Shout could be extended to work out that the word you just typed over is a selector and so the next thing to change would be similar work that also appears to be a selector. Some flexibility in the spelling/matching might help too. Seems to me a *code* editor that can know a great deal about the code it is editing should be able to help a lot more. Doing the UI right would definitely be 'fun'. Eh, another lifetime. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Satisfaction Guaranteed: We'll send you another copy if it fails. |
Free forum by Nabble | Edit this page |