[Bug] Running macro multiple times fails, line by line works
-
Hey all, 7.5.6 64 bit here on windows 10. Having a file of some 35 lines in format:
val:descr
Which I want to flip to:
descr = val,
So I did a fast macro:
<Macro name=“buggy” Ctrl=“no” Alt=“no” Shift=“no” Key=“0”>
<Action type=“0” message=“2442” wParam=“0” lParam=“0” sParam=“” />
<Action type=“0” message=“2177” wParam=“0” lParam=“0” sParam=“” />
<Action type=“0” message=“2180” wParam=“0” lParam=“0” sParam=“” />
<Action type=“0” message=“2451” wParam=“0” lParam=“0” sParam=“” />
<Action type=“1” message=“2170” wParam=“0” lParam=“0” sParam=" " />
<Action type=“1” message=“2170” wParam=“0” lParam=“0” sParam=“=” />
<Action type=“1” message=“2170” wParam=“0” lParam=“0” sParam=" " />
<Action type=“0” message=“2179” wParam=“0” lParam=“0” sParam=“” />
<Action type=“1” message=“2170” wParam=“0” lParam=“0” sParam=“,” />
<Action type=“0” message=“2300” wParam=“0” lParam=“0” sParam=“” />
<Action type=“0” message=“2453” wParam=“0” lParam=“0” sParam=“” />
</Macro>
When I run it on line by line by leaving some time between clicks - everything is fine. If I click faster, or run it till the end of file - at least 3-4 lines are corrupted. Haven’t seen this behavior with previous versions of notepad++. Any idea? -
Hello, Anton, and All,
If you want to run your
buggymacro,Nthtimes, be sure that :-
The cursor is located at the very beginning of the first line
val:descr -
A physical line-break (
CR+LForLF) exists at the end of thenthline
As for me, I did not notice that issue ! Even, holding down the
3keys of the assigned shortcut (Ctrl + Shift + =), the macro changes each line, one after another, without any trouble ;-)Here is, below, my code of the
buggymacro, with N++v7.5.6, on an ( old ! ) Win XP SP3 system<Macro name="buggy" Ctrl="yes" Alt="yes" Shift="no" Key="187"> <Action type="0" message="2442" wParam="0" lParam="0" sParam="" /> <Action type="0" message="2177" wParam="0" lParam="0" sParam="" /> <Action type="0" message="2180" wParam="0" lParam="0" sParam="" /> <Action type="0" message="2451" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="=" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /> <Action type="0" message="2179" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="," /> <Action type="0" message="2300" wParam="0" lParam="0" sParam="" /> <Action type="0" message="2453" wParam="0" lParam="0" sParam="" /> </Macro>
A second and faster solution could be to execute a Search/Replacement, with the the litteral strings, in normal search mode, on all text of a previous selection. So :
-
First, select your block of
val:descrlines -
Open the Replace dialog (
Ctrl + H) -
Find what :
val:descr -
Replace with:
descr = val, -
Tick the
In selectionoption -
Select the
Normalsearch mode -
Click on the
Replace Allbutton
Voilà !
Best Regards,
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login