notepad-plus-plus / notepad-plus-plus

Notepad++ official repository
https://notepad-plus-plus.org/
Other
23.19k stars 4.63k forks source link

Inexplicable error reported during repeated RegEx search #10497

Open bluemonkmn opened 3 years ago

bluemonkmn commented 3 years ago

Description of the Issue

The regular expression: ("1(\^\^([^^]|\^[^^])*){33}\^\^\^|^2(\^\^([^^]|\^[^^])*){108}\^\^\^|^3(\^\^([^^]|\^[^^])*){48}\^\^\^|^4(\^\^([^^]|\^[^^])*){20}\^\^\^) reports an error "Find: Search failed" if the search is attempted twice with the cursor on the first character of the file after the first attempt. Sample.csv

Steps to Reproduce the Issue

  1. Load the attached file into Notepas++ 8.1.3 64-bit
  2. Press Ctrl-F to launch the find window
  3. Paste the following regular expression into the search box: ("1(\^\^([^^]|\^[^^])*){33}\^\^\^|^2(\^\^([^^]|\^[^^])*){108}\^\^\^|^3(\^\^([^^]|\^[^^])*){48}\^\^\^|^4(\^\^([^^]|\^[^^])*){20}\^\^\^)
  4. Ensure the Regular expression option is selected
  5. Click Find Next
  6. The status reports that the expression is not found "Find: can't find the text [...]"
  7. Click the cursor back to the beginning of the file
  8. Click Find Next again
  9. The status message reports the error "Find: Search failed"

Expected Behavior

The same status (from the first attempt) should have been reported for both Find Next clicks.

Actual Behavior

The second click caused status "Find: Search failed" to be reported.

Debug Information

Notepad++ v8.1.3 (64-bit) Build time : Aug 10 2021 - 00:29:32 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : "C:\Users\bmarty\Non-Synced Files\Temp\Sample.csv" Admin mode : OFF Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 2009 OS Build : 19043.1165 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll

ts-50 commented 3 years ago

Cannot reproduce

Notepad++ v8.1.3 (64-bit) Build time : Aug 10 2021 - 00:32:53 Path : C:\Program Files (x86)\Notepad++\notepad++.exe Command Line : "Downloads\Sample.csv" Admin mode : ON Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Home (64-bit) OS Build : 17134.0 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll

bluemonkmn commented 3 years ago

I re-tested this on 8.1.2 64-bit and the steps were slightly different. Step 6 resulted in the message "Find: Found the 1st occurrence from the top. The end of the document has been reached." instead of "Find: can't find the text [...]" It's critical, however, that the cursor be at the beginning of the file with nothing selected for the second attempt.

ts-50 commented 3 years ago

For me it results in: "Find: can't find the text [...]". This is when I have the cursor at the beginning of the file with nothing selected the second time, as stated. There's no difference each time.

bluemonkmn commented 3 years ago

This updated sample.csv reproduces the error more consistently for me. I don't have to perform multiple find operations to get the error; it happens in the first attempt. Sample.csv