-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A recorded macro with "Find Next" and then "Run until the end of file" crashes Notepad++ #13342
Comments
I think there's an even easier way to make this happen:
I'm like 95% sure that the issue is somewhere in the code block that starts here but I don't know C++ so I'm apprehensive about trying to fix it myself. |
I'm also not that familiar with C++ but your fix looks good. As far as I could tell this specific issue is caused somewhere in that if-statement at |
fix issue notepad-plus-plus#13342 To test fix, try making file ``` f f ``` and recording macro of find/replace form searching for f, then running until EOF. This does not break any existing behavior, including: - macros where the cursor moves towards EOF but line num doesn't change (those already stopped after one iteration) - macros where line(s) are deleted with every iteration (even if line number doesn't change, they run until file empty) - macros where the line number increases with each iteration
To test fix, try making file ``` f f ``` and recording macro of find/replace form searching for f, then running until EOF. This does not break any existing behavior, including: - macros where the cursor moves towards EOF but line num doesn't change (those already stopped after one iteration) - macros where line(s) are deleted with every iteration (even if line number doesn't change, they run until file empty) - macros where the line number increases with each iteration - macros where the cursor advances up or down with each iteration but would eventually stop anyway (those end at the correct time) Fix notepad-plus-plus#13342, close notepad-plus-plus#13587
Description of the Issue
When you record a macro that includes a step with "Find Next", and you select "Run a Macro Multiple times" with the option "Run until the end of file", then it will get stuck in a loop and Notepad++ freezes.
Steps to Reproduce the Issue
Example file
pivotResultColumn="data" />
, select & copy/cut it so it's on the clipboardMacro > Start recording
<source column="v
to move the cursor to next instanceEnd
key to go to end of that line/>
pivotResultColumn="data" />
Macro > Stop recording
Macro > Run a Macro Multiple times
Run until the end of file
and press OK.Expected Behavior
The macro should run until the end of the file, so break/stop when "Find Next" wraps around to the beginning of the file, or alternatively when "Find Next" yields no more results.
Actual Behavior
The macro runs indefinitely and Notepad++ freezes
Debug Information
Notepad++ v8.4.8 (64-bit)
Build time : Dec 24 2022 - 19:40:27
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows Server 2019 Standard (64-bit)
OS Version : 1809
OS Build : 17763.3887
Current ANSI codepage : 1252
Plugins :
ComparePlugin (2.0.2)
CSVLint (0.4.6.2)
CsvQuery (1.2.8)
HexEditor (0.9.12)
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4)
NPPJSONViewer (1.40)
NppMarkdownPanel (0.5)
PoorMansTSqlFormatterNppPlugin (1.6.13.31508)
RandomValuesNppPlugin (0.2.1)
XMLTools (3.1.1.13)
fyi, I encountered this while trying to manually edit a large XML file, and paste the
pivotResultColumn
property to the end of eachsource
tag, but only when column name starts with the letterv
.I've found a work-around which is to first
Find > Count
to see how many instances the Find Next will get, for example count is 1389, and then selectRun 1389 times
instead of "until end of file".Also, maybe this is somehow related to issue #12126 ?
The text was updated successfully, but these errors were encountered: