Run until the end of file only runs once
Notepad++ 7.8.2 32-bit on Windows 10 - When I record a macro, open the “Run a Macro Multiple Times” dialog, select “Run until the end of file”, and press “Run”, the macro only executes once. If I choose “Run X times”, it does run X times. What’s really odd is that I’m 99% sure that “Run until the end of file” has worked for me. I’m new to Notepad++, so may not have tried this before, but am pretty sure I have.
One more observation, in case it helps identify the cause:
My testcase is to find the letter ‘a’, then record a macro that replaces ‘a’ with ‘z’ and does a Find Next (F3 in my case). What I’ve noticed is that when clicking the “Run a Macro Multiple Times” Run button with “Run until the end of file” selected, the macro only runs once EXCEPT for the last ‘a’ on the line, in which case it replaces that last ‘a’ as well as the first ‘a’ of the next line before it stops.
Not sure if this indicates anything, but it is different, so I thought I’d pass it on. And I’m sure at some point in the last week this scenario did run to end of file, so something has changed with my install. I’ll keep digging into that too.
Alan Kilborn last edited by
The same thing happens for me when I tried it with a simple Replace action. Actually, I don’t think I’ve ever noticed the Run until end of file option; I’ve certainly never used it. Does anyone know how it is supposed to work (which seems obvious) or how to make it work?
guy038 last edited by
Instead of trying to record a Find ( and Replace ) operation, which is, already, a bit particular, I just recorded a very simple action : Moving to the next character on the right, giving the macro, below, in your active
<Macro name="Next Char on the Right" Ctrl="yes" Alt="no" Shift="no" Key="187"> <Action type="0" message="2306" wParam="0" lParam="0" sParam="" /> </Macro>
And I associated the
Ctrl + =shortcut to this macro
After some tests, with Notepad++
v7.8.2, without any additional plugins installed, I would say that :
Macro > Run a Macro Multiple Times... > Next Char on the Right > Run 'None' or '1' timesmoves caret to next position on the right, as expected
Macro > Run a Macro Multiple Times... > Next Char on the Right > Runx
xthtimes the caret on the right, as expected
Macro > Run a Macro Multiple Times... > Next Char on the Right > Run until the end of filemoves caret to the next position on the right, only and NOT at the very end of file as it should do :-((
Each hit on the
Ctrl + =shortcut moves correctly the caret to next position on the right or downward
If I read your post correctly, you’ve confirmed my original issue i.e. “Run until end of file” does not actually run until the end of the file? If so, then I believe I’ll open a ticket and reference this conversation. Thanks.
In case anyone’s watching this thread, I’ve opened Run until the end of file" only runs once #7801.