Add/Update translation texts for these commits:
* Update English translation for v8.6.8 (indentation setting) (9f6e9c0)
* Add message box with information about disabled backward regex searching (07e9503)
Close#15254
The exception/crash occurs due to the unsupported icon format in Windows Server Core 2022 (due to the lack of a graphical library).
The commit tries to make loading icons fail-safe, and it represents a balance between the functionality of loading icons and the minimal graphic support required for Notepad++:
In the event of loading problems in a typical Windows version with complete graphical library support (which is unlikely but possible), users will receive alerts, and the ICO ID in question will be displayed in the caption.
However, under Windows Server Core 2022, multiple alert message boxes may appear during Notepad++ launch, but they can be stopped after the first one, allowing the user to use Notepad++ normally.
3 choices on the alert message: "Yes" for ignoring error(s) and launch Notepad++, "No" for stop lauching Notepad++ and quit it. "Cancel" for displaying all message error with the loading failure of ICO ID in caption, and launch Notepad++.
Fix#15313, close#15315
Add command line parameter "/runNppAfterSilentInstall" for Notepad++ installer.
This parameter launches installed Notepad++ after silent installation.
Of course, the parameter takes effect only when "/S" (silent installation) is used.
Fix partially #8514, follow up #15230Close#15280
Restore old paste into rectangular selection behavior: only call pasteIntoMultiSelection for multiple stream selections and not for rectangular selections.
Fix#15139, fix#15151, close#15261
New Notepad++ NSIS installer cmdline option.
If specified on the cmdline, it first tries to use the usual app-closing by sending the WM_CLOSE message to the running Notepad++.
If that standard closing fails, it uses consequently the forceful TerminateProcess WINAPI way.
Partially fix the #8514, followup of the #14251.
Close#15230
Implement some size limits for the Notepad++ docked and floating panels, as the users often "lost" its panels (e.g. when they minimized them to zero width or height).
This also fixes the config.xml possible previous "out-of-the-allowed-range" data.
Fix#13084, close#15236
- zero init LexSearchResult.cxx lineBuffer
- WindowsDlg::resetSelection() add nullpointer check as assert just triggers on debug builds
- added missing nullpointer checks in Utf8_16.cpp on allocated memory
- added missing nullpointer check on notifyView for case SCN_AUTOCSELECTION in NppNotification.cpp
- added missing nullpointer check on clipboardData in NppCommands.cpp
Close#15195
- update CI link from appveyor to GH action
- add option to makefile build mingw build also with Clang++ instead of g++
- add option to makefile to enable clang analyzer
Close#15189
Tweak dark mode custom draw for plugin:
- add plugin custom draw support for toolbar
- make code more consistent
- make plugin's authors custom draw implementation
to have higher priority than one from generic dark mode
ref #15078 (comment)
Close#15147
- added autoCompletion for Go and Raku to installer script.
- added function list for Raku as starting point, currently just an adapted copy of the perl functionlist.
Related to #15000 and #14966Close#15128
Check if URL is enclosed in apostrophes or backtick (grave accent). Only if URL is directly preceded by apostrophe/backtick and URL ends with apostrophe/backtick respectively.
Fix#14978, fix#14323, fix#14212, close#15058
Changes:
Ada is case insensitive
Added 'Parallel' reserved word
Identifiers may not begin or end with underscore
Support for identifiers containing digits
Support for Ada specifications file (subprogram declaration) (#14687)
Support for dot notation within types (#14908)
Support for generic instantiations (#14498) (functions with no return statement)
Fix#14908, fix#14687, fix#14498, close#14986
Using the composition instead of the multiple inherence
1. For preventing from the diamond problem.
2. To fix the semantic problem by using DPIManagerV2 as class ancestor of class StaticDialog.
Remove also unecessary scaleX, unscaleX, scaleY & unscaleY methods.
Sintilla Release 5.5.0 (https://www.scintilla.org/scintilla550.zip)
Released 23 April 2024.
Add elements for inactive additional selections SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT and SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK. When not set these default to SC_ELEMENT_SELECTION_INACTIVE_TEXT and SC_ELEMENT_SELECTION_INACTIVE_BACK. Bug #2417.
On Cocoa, avoid use of NSUserDefaults which will soon require justification when used in applications on the App Store.
Fix Win32 IME crash in windowed mode. Bug #2433.
Scale reverse arrow cursor for margins to match other cursors when user changes pointer size. Bug #2321.
Lexilla Release 5.3.2 (https://www.scintilla.org/lexilla532.zip)
Released 23 April 2024.
COBOL: Stop string literal continuing over line end. Issue #229.
COBOL: Stop doc comment assigning different styles to \r and \n at line end. Issue #229.
COBOL: Recognize keywords that start with 'V'. Issue #230.
COBOL: Recognize comments after tag or that start with '/'. Issue #231.
HTML: Implement substyles for tags, attributes, and identifiers SCE_H_TAG, SCE_H_ATTRIBUTE, SCE_HJ_WORD, SCE_HJA_WORD, SCE_HB_WORD, SCE_HP_WORD, SCE_HPHP_WORD.
HTML: Implement context-sensitive attributes. "tag.attribute" matches "attribute" only inside "tag".
HTML: Match standard handling of comments. Issue #232.
Lua: Implement substyles for identifiers SCE_LUA_IDENTIFIER.
Ruby: Allow non-ASCII here-doc delimiters. Issue #234.
Ruby: Allow modifier if, unless, while and until after heredoc delimiter. Issue #236.
Rust: Recognize raw identifiers. Issue #239, Pull request #240.
Close#15042
- reorder controls for consistent tab switch
- make spacing and position more consistent
- use system aware or gdi scaling for Color dialog and Color popup
ref #14959Close#15029
- StringDlg (Rename Current Tab, ...)
- UDL Styler
- UDL in undock state
- UDL allow tab switching between main dialog and subdialogs
- make controls spacing and size consistent
ref #14959Close#15024
- Run
- Run a Macro Multiple Times...
- Shortcut
- code enhancement
- add override in shortcut.h
- modify switches in WM_COMMAND
- optimize dark mode for shortcut
- avoid potential multiple subclassing for Run dialog
ref #14959Close#15017
Currently while flush file buffers action fails at not critical end session, a error message dialog display the problem.
It raises the problem of some external process interfering with the Notepad++ file saving (via NppSaveAsAdmin plugin).
This commit logs this error at critical end session, so if NUL characters content issue happens to the users again, we can try to know what was happening, plus users' plugin list.
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14990#issuecomment-2054242025Close#15003
- fix linux build on include upper/lowercase issue ../src/dpiManagerV2.cpp:20:10: fatal error: CommCtrl.h: No such file or directory
- avoid clang warning: 5>..\src\WinControls\Grid\BabyGrid.cpp(677,7): warning : unused variable 'rectwhole' [-Wunused-variable]
- avoid ../src/NppCommands.cpp:1790:24: warning: conversion from ‘int’ to ‘UCHAR’ {aka ‘unsigned char’} may change value [-Wconversion]
Close#15001
To be able to work with 2GB+ files, we have to use the Scintilla SC_DOCUMENTOPTION_TEXT_LARGE flag.
Until now, this flag was only used if a file > 2GB was to be loaded. For files smaller than 2GB or newly created empty ones, it was not used. This left the room for a Notepad++ crash situation because of the user has been left the possibility to cross this threshold (e.g. by pasting a data which in sum with the already existing ones in the Notepad++ filebuffer exceeds that 2GB...)
So one has two options: either a complex monitoring of the Notepad++ filebuffers size and reloading these with that large-flag when reaching the 2GB or simply using that large-flag as the default one from the start (which is what this patch does...).
Fix#14981, close#14982
- avoid upper/lowercase issue for #include <windowsx.h>
- casts to avoid warning: conversion from ‘int’ to ‘UCHAR’ {aka ‘unsigned char’} may change value [-Wconversion]
- cast to avoid warning: conversion from ‘int’ to ‘BYTE’ {aka ‘unsigned char’} may change value [-Wconversion]
- avoid warning : delete called on non-final 'FileDialogEventHandler' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
- avoid warning : warning: extra ';' [-Wpedantic] in BabyGrid.cpp
Close#14950
Previously there was the 4096 MB max limit, so when e.g. user set this 4GB threshold and then tried to open any 2GB+ file, the Scintilla CellBuffer::Allocate method throwed a std::runtime_error because currently the Notepad++ does not use the SC_DOCUMENTOPTION_TEXT_LARGE in such a case.
The function "addHotSpot" can become very slow when the screen contains certain sequences of characters that look like URLs but are not valid, due to a form of backtracking. This change eliminates the possibility of backtracking.
This commit does two things:
First, it tightens the requirements for “looks like a URL” by checking the scheme earlier in the process. That is necessary to keep the next step from skipping valid URLs in reasonable contexts.
Second, once the beginning of a potential URL passes the tighter initial scanning and the end of the URL is found, we “commit” to that portion of the line. If the potential URL fails InternetCrackUrl validation, we restart scanning from the end of of the string that looked like a URL but wasn’t, rather than from just after the scheme.
Fix#13916, close#14900
The crash occurs because the thread terminates the task prematurely due to PostMessage’s nature. As a result, FileManager::backupCurrentBuffer() is always executed by the main thread, leading to a deadlock ( due to "std::lock_guard<std::mutex> lock(backup_mutex);") on the 2nd main thread’s entry and causing the crash. Here the explanation:
"If lock is called by a thread that already owns the mutex, the behavior is undefined: for example, the program may deadlock."
ref: https://en.cppreference.com/w/cpp/thread/mutex/lock
Using SendMessage instead of PostMessage ensures that the thread executes the task from the beginning to the end and keeps the mutex until the entire operation is terminated. Therefore, the race condition is prevented by the mutex lock while the 2nd thread tries to access the same code/zone.
Fix#14906, close#14917
Fix possible session backup swapping when no session.xml file.
The ReplaceFile WINAPI failed when the session.xml file replaced did not exist.
This commit follows the commit aa3777786dClose#14887
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
Add NPPN_GLOBALMODIFIED to notify plugins that the current document is just modified by Replace All action.
//scnNotification->nmhdr.code = NPPN_GLOBALMODIFIED;
//scnNotification->nmhdr.hwndFrom = BufferID;
//scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero
For solving the performance issue (from v8.6.4), Notepad++ doesn't trigger SCN_MODIFIED & other Scitilla notifications during Replace All action anymore.
Plugin devs should monitor NPPN_GLOBALMODIFIED instead. This notification is implemented in Notepad++ v8.6.5.
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14685#issuecomment-1955229867Fix#14767, close#14768
While saving a file needs the admin privilege, and if "Always In Multi-Instance Mode" option is activated, the current Notepad++ instance will be closed and a new instance with admin privilege contains no file is launched - it makes user confused because there are nothing to be edited and saved.
This commit fixes the issue by keeping the 1st instance opened, and launching the 2nd instance (with admin privilege) which contains the file in question - so user can modify it and save it.
The new behaviour (of this commit) not only fixes the issue, but also makes more sense, since it's "Always In Multi-Instance Mode". Note that the same behaviour happens if the session & periodical backup feature is disabled.
Fix#14694, close#14701