A crash regression (Fixed by cf0a5c8edc) has been caused by the returned null pointer.
This commit makes the returned value safer: use empty string instead.
Close#17212
- fully replace it with V2
- add text scaling support to task dialog list
- modernize task dialog code
- clean and remove unused include headers
Close#17189
While **Use Unicode UTF-8 for worldwide language support** is checked:
1. ANSI commands is disabled.
2. Encoding "ANSI" & "Applied to opened ANSI file" options are disabled in "New Document" section of Preferences.
3. Open the "single byte" files with the old code page, if the encoding detection finds nothing.
Fix#17057, fix#17033, close#17080
1. More understandable naming: "javascript.js" to "JavaScript".
2. Disassociate the value of Embedded JS & JavaScript, and remove Embedded JS from the list.
3. Prevent from eventual crash due to null pointer.
Fix#16884, close #16885
The regression is introduced by:
83755ca155 (diff-d88ddee57a027ab23daf332c4778ced0cee352edcb34efdda1b218e8a75c61b2L2636)
The culprit of this regression is the deletion of following 4 lines in the commit above:
```
void ScintillaEditView::fold(size_t line, bool mode, bool shouldBeNotified/* = true*/)
{
auto endStyled = execute(SCI_GETENDSTYLED);
auto len = execute(SCI_GETTEXTLENGTH);
if (endStyled < len)
execute(SCI_COLOURISE, 0, -1);
```
The method "ScintillaEditView::fold()" is called not only on manual folding by the users, but also on:
1. startup's loading session to restore the folding state programmatically.
2. after startup, switching among the documents to restore the folding state programmatically.
The above lines are important for the case 1.
However, these lines are necessary only on the first load of each file after the startup of Notepad++.
"execute(SCI_COLOURISE, 0, -1);" needs to be run for once (the case 1), not twice or more (the case 2).
So if there's a way to detect if a document has been run "execute(SCI_COLOURISE, 0, -1);" once (in the case 1),
and don't run it again (the case 2), it will save the time to switch among the document.
Fix#16597, close#16599
Fix swiching back to document which has processed hide lines makes Notepad++ unresponsive due to an infinite loop.
Fix also setting language makes hiding lines unhidden issue.
Fix#16316, close#16512
Make right-click message handler x-margin calculation right.
Previously, the incorrectly used unsigned variable (size_t) overflowed with negative numbers due to incorrect calculation of margin size.x (where possible horizontal scrolling was not taken into account...).
Fix#16325, close#16332
- Use the Scintilla dedicated command SCI_FOLDALL to replace the inefficient loop for "Fold All" command.
- Fix "Fold level" & switching back to large files folding performance.
- Refactoring the hide/show lines functions.
Note that there might be a regression of URL link:
https://github.com/notepad-plus-plus/notepad-plus-plus/pull/16200/files#r1961937279
The commit is based on code of #16064.
Fix#16064, close#16200
Enable Sctintilla's SAS lexer, populate langs.model, stylers.model, and themes.
(includes keyword lists from UDLs, notepad4, and SAS documentation)
Fix#16148, close#16183
Add **NPPM_ADDSCNMODIFIEDFLAGS** message for plugins which need the SCN_MODIFIED notification of other events.
BOOL NPPM_ADDSCNMODIFIEDFLAGS(0, unsigned long scnMotifiedFlags2Add)
Add needed SCN_MODIFIED flags so your plugin will recieve the notification SCN_MODIFIED of these events for your specific treatments.
By default, Notepad++ only forwards SCN_MODIFIED with the following 5 flags/events SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT | SC_PERFORMED_UNDO | SC_PERFORMED_REDO | SC_MOD_CHANGEINDICATOR to plugins.
If your plugin need to process other events of SCN_MODIFIED, you should add the flags you need by sending this message to Notepad++, just after recieving NPPN_READY.
wParam: 0 (not used)
lParam[in]: scnMotifiedFlags2Add- Scintilla SCN_MODIFIED flags to add.
Return TRUE
Ref: https://community.notepad-plus-plus.org/topic/26588/notepad-v8-7-6-released/2?_=1738167940554Fix#16121, close#16120