-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
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
<mappingPart>
<source column="v_0" />
<destination observationCode="demin_leefstijl_0" />
</mappingPart>
<mappingPart>
<source column="v_1" />
<destination observationCode="demin_leefstijl_1" />
</mappingPart>
<mappingPart>
<source column="v_2" />
<destination observationCode="demin_leefstijl_2" />
</mappingPart>
- Type the text
pivotResultColumn="data" />, select & copy/cut it so it's on the clipboard - Go to beginning of the example file
- Go to menu
Macro > Start recording - Ctrl+F to find next
<source column="vto move the cursor to next instance - Press
Endkey to go to end of that line - select last two characters
/> - Paste
pivotResultColumn="data" /> - Go to menu
Macro > Stop recording - Now go to
Macro > Run a Macro Multiple times - Select
Run until the end of fileand 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 each source tag, but only when column name starts with the letter v.
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 select Run 1389 times instead of "until end of file".
Also, maybe this is somehow related to issue #12126 ?