Notepad2e
Notepad2e copied to clipboard
Remove input length limit in dialogs
Inputs in Alt+M, Alt+Q and possibly elsewhere don't accept more than 255 symbols (not bytes). Ctrl+F/H inputs accept 500 at most which is better but still insufficient. What is the reason for these limits?
General EDITFINDREPLACE structure contains the following text buffers:
512 - is the max string length (including trailing 0) internally allowed (for now) for proper Find/Replace work.
Other procs use predefined buffers:

@cshnik Do text inputs have any limits of their own in WinAPI? Or Notepad2's limits are the only reason?
MSDN states edit control text length limits (EM_LIMITTEXT):
For single-line edit controls, the text limit is either 0x7FFFFFFE bytes or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either -1 byte or the value of the wParam parameter, whichever is smaller.
Changes required to support unlimited text length are:
- Replace fixed length text buffers with struct
pointer + length - Implement procs for text buffers allocations/relocations
- Review every call to text buffers and fix it accordingly
The simplest way would be to adjust fixed text length to a reasonable big value and let all the other code work as is.
The simplest way would be to adjust fixed text length to a reasonable big value and let all the other code work as is.
Indeed, let's increase all buffers' lengths by 10. Currently they use 5 KiB in total, this will be 50 KiB then (there is always one _editfindreplace instance per process, right?).
Fixed.
We've increased MRU (#447) and input limits but keep in mind WinAPI's limit of 32767 characters per INI section:
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofilesection