-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Is there an existing issue for this?
- I have searched the existing issues
Description of the Issue
When using the Find/Replace dialog, typing or pasting a long search/replacement text seems to work fine (you can keep typing and the characters are displayed), but when launching the search/replace the content gets truncated.
This is a very old issue, it was reported in 2015 already, and closed for no reason other than getting too old: #1088
Steps To Reproduce
- Open a file, e.g. generate one with Python:
python -c 'print("\n".join(["element %d" % i for i in range(1, 359)]))' > npp_search_truncation_bug.txt - Open the search or replace dialog
- Enter a very long text (more than 2046 characters) in the "Find what" field, or paste it. For example, if you're searching in regex mode, generate a pattern with:
python -c 'print("element " + "|".join(["(%d)" % i for i in range(1, 359)]))' - Same for the "Replace with" field, if you're in the Replace dialog. For example, if you're replacing in regex mode, generate the pattern with:
python -c 'print("".join(["(?{%d}%d)" % (i, 10000 + i) for i in range(1, 359)]))' - Check that the field(s) you've filled in are properly displayed until the end, without any truncation
- Run the search/replace, by clicking on "Find Next"/"Replace"/etc.
Current Behavior
The "Find what" (and "Replace with") field gets truncated to 2046 characters, without any warning, only when you run the search/replace. If you're in regex mode and the resulting search pattern is invalid, you will at least immediately see that there's a problem; in other cases, the problem may remain more hidden.
Expected Behavior
It's understandable that the fields have a hardcoded limited size, but that should made be clear to the user: the extra text should not even be displayed in the fields, and clear feedback should inform them that they've reached the limit.
Ideally, the allowed text size in the fields should also be much larger than 2046 characters, if that's not too unwieldy for Notepad++. The need to perform such long searches/replacements is not so outlandish, at least when using regular expressions and substitution conditionals.
Debug Information
Notepad++ v8.8.1 (64-bit)
Build time : May 3 2025 - 18:41:09
Scintilla/Lexilla included : 5.5.6/5.4.4
Boost Regex included : 1_85
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "D:\backup1\Paperasse\vélib.txt"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
Placeholders : OFF
Scintilla Rendering Mode : SC_TECHNOLOGY_DIRECTWRITE (1)
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 24H2
OS Build : 26100.4349
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)Anything else?
No response