Replies: 9 comments 3 replies
-
I usually do that kind of thing using a Regular Expression in the Replace dialog, I find it more powerful than using macros. For your specific example this works for me: Start by getting the Find regex working and use parentheses to capture all the parts that you need in your replacement string, then add the replacement side. You can move the focus to the text window and use Undo (Ctrl+Z) to undo a replacement in order to fix and retry it. Once you have a single substitution working properly the "Replace & Find" button allows for manual confirmation that it located an appropriate spot first, or the "Replace all in" Window and Selection buttons let you repeat it much faster. |
Beta Was this translation helpful? Give feedback.
-
That is indeed more professional, thanks. And it would work better when there are variations in the format of the lines. The step-by-step keyboard macro relies on a completely regular line format. In fact even different trailing blanks often blow it up :=( |
Beta Was this translation helpful? Give feedback.
-
But, I'm still interested in how to call repeat_macro("Learn/Replay", n), it could be useful in quite a few situations. |
Beta Was this translation helpful? Give feedback.
-
Well, I'm honestly unsure exactly how that could be used correctly! Truth be told, I'm not personally a heavy macro user. I love nedit for its regex capabilities. But there may be a way to do what you intend. Hopefully one of us will be able to figure it out :-P. |
Beta Was this translation helpful? Give feedback.
-
I can say that you can use navigation macros like |
Beta Was this translation helpful? Give feedback.
-
Hmm, I will try to come up with a good use case, where ' repeat_macro("Learn/Replay", nn) ' would be really convenient. |
Beta Was this translation helpful? Give feedback.
-
I've been thinking about this one... It sounds like what you want is for whatever is in the "learn/replay" macro buffer, to be able to called by name in a macro itself. Perhaps it could be available as like
This would also allow:
Or something like that, which would enable you to record a macro, and then replay whatever that macro was via another macro (It is admittedly hard to imagine what I would use this for given that there is a method to do this via the dialog if I understand what you're trying to do here). |
Beta Was this translation helpful? Give feedback.
-
Yes that's pretty much what I was thinking. I'll definitely come up with a good use case soon. |
Beta Was this translation helpful? Give feedback.
-
"Repeat In Selection" is a good thought. Damn. Well I'll keep pondering here. |
Beta Was this translation helpful? Give feedback.
-
Hi, great idea to start up Github "Discussions".
Here's a question then - I'd like to be able to make a macro, in autoload.nm, to repeat the last "Learn/Replay" keyboard macro N times. This is just to streamline things .. maybe I'm doing a repetitive change to a series of lines, like turning:
into ..
and I've fumbled my way through a keyboard macro to change one line, with numerous mistakes and corrections, that's ok, efficiency isn't any consideration, and I would like to call repeat_macro("Learn/Replay", 20) from a keystroke, to rapidly work down the list, and near the end I can use Cmd-K to finish the last few lines.
I can't manage to successfully call repeat_macro("Learn/Replay", N), or discover the format that nedit-ng wants by looking in
DialogMacro.cpp
andmacro.cpp
. I'm still working on it, but maybe y'all know the answer. Also, it occurs to me this may not be catered for in Nedit, it's a bit recursive I guess, calling a macro from a macro, kind of.Thanks !
Beta Was this translation helpful? Give feedback.
All reactions