Fix memory overwriting bug by BabyGrid:
BabyGrid code was overwriting foreign memory on its initialization and deinitialization. At that time (WM_NCCREATE, WM_NCCALCSIZE, WM_CREATE and WM_NCDESTROY) the relevant FindGrid func returns -1, which was used as an index pointing to a memory area before the whole BGHS object (BGHS[-1]...)!
This was a long-standing hidden bug that only started to manifest itself probably when the app memory layout shifted somehow and important objects/data started to be overwritten, resulting in the visible app crashes.
Fix https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14855#issuecomment-2001066992 , https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14871#issuecomment-2002485089
=========
Sernario:
=========
When a user modifies a file in Notepad++, and the time of periodic backup (defaulted to 7 seconds) is reached, the backup of the modified file is being written. However, if a power outage occurs during this precise moment while the file is being written, file corruption may occur.
=======
Remedy:
=======
The goal is to maintain a non-corrupted file sample even during power outages. Here are the steps:
0. Begin
1. Write the file A as A.temp
2. Replace A by A.temp
3. End
During these steps, the cutoff can happen at any moment, but the user will always have a non-corrupted file sample (either A or A.temp).
=====
Note:
=====
The solution is only applied to "new #" files, since these files are generally small in length and do not have a second "physical" file existing on the hard drive.
ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/6133#issuecomment-1987037043Fix#6133, close#14860
In case of "session.xml" being corrupted after the power outrages, "session.xml.inCaseOfCorruption.bak" will replace "session.xml" on the next Notepad++ startup.
Fix#14781, close#14858
Sintilla [Release 5.4.3](https://www.scintilla.org/scintilla543.zip)
* Release 5.4.3: Released 9 March 2024
1. Fix redo failure introduced with 5.4.2. [Bug #2432](https://sourceforge.net/p/scintilla/bugs/2432/).
2. Add SC_AUTOCOMPLETE_SELECT_FIRST_ITEM option to always selects the first item in the autocompletion list. [Bug #2403](https://sourceforge.net/p/scintilla/bugs/2403/).
* Release 5.4.2: Released 5 March 2024
1. Significantly reduce memory used for undo actions, often to a half or quarter of previous versions. Feature #1458.
2. Add APIs for saving and restoring undo history.
3. For GTK, when laying out text, detect runs with both left-to-right and right-to-left ranges and divide into an ASCII prefix and more complex suffix. Lay out the ASCII prefix in the standard manner but, for the suffix, measure the whole width and spread that over the suffix bytes. This produces more usable results where the caret moves over the ASCII prefix correctly and over the suffix reasonably but not accurately.
4. For ScintillaEdit on Qt, fix reference from ScintillaDocument to Document to match change in 5.4.1 using IDocumentEditable for SCI_GETDOCPOINTER and SCI_SETDOCPOINTER.
5. For Direct2D on Win32, use the multi-threaded option to avoid crashes when Scintilla instances created on different threads. There may be more problems with this scenario so it should be avoided. Bug #2420.
6. For Win32, ensure keyboard-initiated context menu appears in multi-screen situations.
Lexilla [Release 5.3.1](https://www.scintilla.org/lexilla531.zip)
* Release 5.3.1: Released 5 March 2024
1. Assembler: After comments, treat \r\n line ends the same as \n. This makes testing easier.
2. Bash: Fix folding when line changed to/from comment and previous line is comment. Issue #224.
3. Batch: Fix handling ':' next to keywords. Issue #222.
4. JavaScript: in cpp lexer, add lexer.cpp.backquoted.strings=2 mode to treat ` back-quoted strings as template literals which allow embedded ${expressions}. Issue #94.
5. Python: fix lexing of rb'' and rf'' strings. Issue #223, Pull request #227.
6. Ruby: fix lexing of methods on numeric literals like '3.times' so the '.' and method name do not appear in numeric style. Issue #225.
Close#14834
https://www.scintilla.org/scintilla542.zip
Release 5.4.2
Released 5 March 2024.
Significantly reduce memory used for undo actions, often to a half or quarter of previous versions. Feature #1458.
Add APIs for saving and restoring undo history.
For GTK, when laying out text, detect runs with both left-to-right and right-to-left ranges and divide into an ASCII prefix and more complex suffix. Lay out the ASCII prefix in the standard manner but, for the suffix, measure the whole width and spread that over the suffix bytes. This produces more usable results where the caret moves over the ASCII prefix correctly and over the suffix reasonably but not accurately.
For ScintillaEdit on Qt, fix reference from ScintillaDocument to Document to match change in 5.4.1 using IDocumentEditable for SCI_GETDOCPOINTER and SCI_SETDOCPOINTER.
For Direct2D on Win32, use the multi-threaded option to avoid crashes when Scintilla instances created on different threads. There may be more problems with this scenario so it should be avoided. Bug #2420.
For Win32, ensure keyboard-initiated context menu appears in multi-screen situations.
https://www.scintilla.org/lexilla531.zip
Release 5.3.1
Released 5 March 2024.
Assembler: After comments, treat \r\n line ends the same as \n. This makes testing easier.
Bash: Fix folding when line changed to/from comment and previous line is comment. Issue #224.
Batch: Fix handling ':' next to keywords. Issue #222.
JavaScript: in cpp lexer, add lexer.cpp.backquoted.strings=2 mode to treat ` back-quoted strings as template literals which allow embedded ${expressions}. Issue #94.
Python: fix lexing of rb'' and rf'' strings. Issue #223, Pull request #227.
Ruby: fix lexing of methods on numeric literals like '3.times' so the '.' and method name do not appear in numeric style. Issue #225.
Add "ATTRIBUTE" color in Python.
Only DarkModeDefault.xml & Zenburn.xml are modified due to the other themes missing "DECORATOR" color with which "ATTRIBUTE" color uses.
I let people who use those themes and need "DECORATOR" & "ATTRIBUTE" colors to modify them.
Fix#5894, close#14830
1. Use appropriated localized title on some main save/open dialogs.
2. Reuse menu localized string and remove some redundent entries from localization files.
Fix#14737, fix#11860, close#14808
Fixes possible Notepad++ non-GUI state when minimized to systray with an unsaved file, closing from the systray icon & then cancelling that closing from the invoked Notepad++ save dialog.
Fix#14777, close#14778
When Notepad++ is minimized and there are 2 or more unsaved opened files,
close Notepad++ directly from the taskbar (no periodic backup) will launch modal Save All dialog,
which will not be on the foreground. Hence the blocage of Notepad++.
This commit fixes the issue above.
Fix#14718, close#14725