The PR fixes the regression due to the saving file API being changecd from POSIX functions to Win32 native API:
The old used function "fopen" using "wbc" as argument, according Microsoft document:
"w" Opens an empty file for writing. If the given file exists, its contents are destroyed.
(https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-160)
so to save a 0 length document, it was unecessary to "write nothing" explicitely on disk, since fopen did it for you.
Whereas our new implementation which uses Win32 native API passes "OPEN_ALWAYS" - that needs to "write nothing" explicitely.
Fix#10699, close#10702
Instead of writting on hard disk little by little all the time,
all data is collected in a string buffer to write once on the disk at the end.
Fix#10678, fix#10674, close#10691
Notepad++ dark mode works fine under Microsft Windows 7, 8, 8.1 & 10.
Under Windows 11 while Notepad++ being switched into dark mode,
the hightlighting (background) of toolbar's hot-track icons remains in light mode.
Hence this workaround to remedy Notepad++ dark mode visual glitchy due to the bug of Windows 11.
Fix#10510, close#10685
When using dark mode with a theme other than DarkModeDefault the background and font color of the theme are not applied to all styles.
This PR fix this bug by adding colorStyle="1" to ignore defined background colour in UDL, and use the default's background colour (theme's one) instead.
Fix#10593, close#10619
This PR make buffer always dirty (with any undo/redo operation) if the editing buffer is unsyncronized with file on disk.
By "unsyncronized", it means:
1. the file is deleted outside but the buffer in Notepad++ is kept.
2. the file is modified by another app but the buffer is not reloaded in Notepad++.
Note that if the buffer is untitled, there's no correspondent file on the disk so the buffer is considered as independent therefore synchronized.
Fix#10401, close#10616
1. Rename CFile to Win32_IO_File (plus some modification in class).
2. Add new method writeStr() in Win32_IO_File class to write "char*" & string.
3. Change method names of Utf8_16_Write class and make writeFile() method return accurate type (boolean).
Close#10612
Uses native Win32 IO API (CreateFile, ReadFile, WriteFile, CloseHandle) instead of POSIX ones (fopen, fread, fwrite, fclose) for remedying NUL file-corruption problem due to system shutting down brutally.
Fix#6133, close#10598
Fixed a condition in a loop which is always true (unsigned >= 0) and can
potentially turn the loop infinite.
And removed a check after the loop which now is also always false.
Close#10597