Make the following context menu items translatable:
1. "Style all occurrences of token"
2. "Style one token"
3. "Clear style"
4. "Plugin commands"
Note for translators: to test your translation, you have to replace the old "contextMenu.xml" with the new one (modified in this commit).
Fix partially #8972Fix#9713, close#11031
in some circumstance people have to ENTER twice to have 1 newline feed.
In this commit, 2 options (ENTER & TAB) are given in Auto-completion settings, so users can choose one of these 2 keystrokes (or both, or none). By default ENTER is disabled and TAB is enabled.
If auto-completion is disabled and completion is triggered manually, then the settings of ENTER & TAB won't be considered, both ENTER & TAB will be able to insert the selection.
Fix#4799, fix#4631, fix#8389, fix#10915, close#11016
In the following configuration loaded session will be empty on exit
* Remember current session for next launch: OFF
* Open session in a new instance: ON
This commit fix the issue.
Fix#10986, close#11017
If user tries to save a existing file as file itself by using "Save As" command,
then he/she chooses the same file from the Save As file dialog,
* old wrong behaviour: "Save As" action is rejected with the message "The file is already opened in Notepad++".
* new correct behaviour: "Save As" action is allowed.
Fix#10965, close#11008
1. Add new commands to copy selected files name/path into multi-selection context menu in Document List.
2. Add new commands to copy all files name/path into Edit > Copy to Clipboard.
3. Create a new function buf2Clipborad() to be used in all similar commands.
4. Fix the translation of the Document List multi-selection context menu.
Fix#10394, close#10993
Translation update to follow this commit:
* Add auto save loaded session on exit feature (a16930fffe)
Also, fix for looking of parentheses for inconsistency.
Fix#10949
Rename current tab & Rename User Language name could be up to 63 characters now!
(Before this implementation the limit size is about 20 characters)
Fix#10961, fix#9849, close
1. Document List icons now support darkmode icons and alternate icons.
2. Fixed memory leak in code and additional code refactoring.
Fix#10740, close#10956
This PR allows users to provide the list of excluding folder names/patterns in "Filters" field.
Eclusion operator is alway "!" at the begining. In order to distinguish folder from file, "\" should be used as prefix of the folder name/pattern, following "!". That allows the exclusion of the directories under the root directory you want to search (the 1st level of matched directories).
If users need to exclude folders with the same name (or names matched the specific pattern) in all levels, the + should be put between "!" and "\" to exclude them recursively.
Here is a sample:
Filters: *.* !\bin !+\test !+\log*
Directory: c:\myProject\
So the excluded directories could be:
c:\myProject\bin\
c:\myProject\log\
c:\myProject\logs\
c:\myProject\src\log4j\
c:\myProject\test\
c:\myProject\src\test\
The following directories will not be excluded:
c:\myProject\foo\tests\
c:\myProject\foo\bin\
Note that "inclusion of folder" is not allowed, and such pattern will be ignored.
Fix#2433, fix#8350, close#10927
Added these translations:
* Add "Notepad++ User Defined Languages Collection" project website ... (add9f64104)
* Update english.xml (7aa0a56320)
Close#10848
These logs are written for debugging NUL file-corruption issue (#6133) and session lost issue (#10402) which are still problematic probably.
The writting log info will be triggered only when Windows notifies Notepad++ to end session.
The log file will be in "%APPDATA%\Notepad++\" or in Notepad++ installation folder if doLocalConf.xml is present.
To disable the log, just remove nppLogNulContentCorruptionIssue.xml.
Close#10871
And add log ability for debugging network drive file status detection issue.
To activate log, user should:
1. Add an empty "nppLogNetworkDriveIssue.xml" file beside of notepad++.exe, or if user has no admin previlege, he/she can add this file into %APPDATA%\Notepad++\.
2. Create "C:\temp\" directory, if it doesn't exist yet.
3. Start notepad++.exe, and wait for the file status (timestamp) detection error from the network drive. If the errors occur, there should be some trace in "C:\temp\nppLogNetworkDriveIssue.log".
People who have had the network drive file status detection issue in #10688, #10753, #10757, #10751 & #10787 are welcome to download the binary and provide the generated log in order to fix this issue.
Fix#10751, fix#10688, fix#10753, fix#10757, fix#10751, fix#10787, close#10847
It's rather a bug of Windows' API than the bug of Notepad++. The visual glitch comes from TreeView (FunctionList, Folder As WorkSpace, Project Panels etc ...) but ListView (ASCII Insertion Panel & Document List) works fine.
I have done some fixes about this issue. However, it's not perfect when use mouse to do the snapshot.
OTOH, once the click done to show Notepad++, it becomes normal.
This is the best fix I can offer for this bug.
Fix#2202, fix#2937, fix#5980, fix#8980, fix#9905, fix#10091
Add all missing date time translations from v8.1.5.
Update 42083 and 42078 to not use the word sort (sortieren) because english.xml doesn't either.
Move items 41025 and 44109 to the same order like in english.xml for more easy diffing.
Delete obsolete/doubled item 42079 (it was there two times in german.xml).
Close#10730
This regression is due to the saving routine's change:
9aa9ecb664
Normally, on each save, buffer's timestamp is updated for the future comparison with the timestamp on the disk, in order to detect the modification from outside.
It seems the new saving routing makes the change (ONLY on network disk) with the timestamp before buffer's timestamp, for unknown reason.
The fix is: if timestamp got directly from the file on disk is earlier than buffer's timestamp, it's an absurd case and we ignore it. The buffer's timestamp will be only updated if the file on disk timestamp is later than buffer's one.
Fix#10688, fix#10753, fix#10757, close#10774
Some users encounter the issue that files cannot be saved sometimes.
It's due to the share parameter in CreateFile() set as 0, which makes sense for preventing other process from accessing to the file being written. However, when Notepad++ tries to write the file, it opens the file for writing. If at that moment the file is already opened by other program and the share flag is zero, then the system is instructed to deny opening the file on share conflict and the open fails.
Setting share parameter to "FILE_SHARE_READ" instead of 0 solve this problem.
Fix#10751, close#10765
Comments styles in stylers.model.xml are inconsistent with Scintilla's states
described in /scintilla/include/SciLexer.h. Moreover, block comments are
highlighted with not the same style as line comments, but with style used for
"COMMENT LINE BANG" in other languages.
I eliminated the "COMMENT LINE" style, which Scintilla does not generate, fixed
the "COMMENT BLOCK" style to be the same as regular "COMMENT", and added a
separate style, "COMMENT LINE BANG", for special comments.
Close#10748
Checkboxes "Transparent" of bg & fg color are added for each styler.
The bg color and/or fg color set in current Styler will be ignored and the dark/light theme's bg/fg color will be used, if the checkbox "Transparent" is checked.
To make generic UDL for all dark themes, user has to enable "Transparent" checkboxes for both bg and fg color in "Default Style", then set all the other styles with bg color transparent, or set both non-transparent, according the need of your token to be colorized.
Fix#10738
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
Added translations for these commits:
* Make "Confirm Save All" dialog more clear (deab93f9b5)
* Make Incremental Search panel translatable (e12b161d48)
* Add custom date time insert (84c1505fab)
Close#10477
Notepad_plus_Window was rather huge (megabytes). Now it's small (tens of kilobytes),
but to safeguard against future size increase move its allocation from the stack
into the heap.
By using smart pointer, this PR not only fix open file crash properly,
but also prevent stack from being corrupted in the future.
Fix#10454, close#10531
Default DarkMode theme style for PHP was missing one element (COMPLEX VARIABLE).
Also Make variables in strings bold so they are more distinguishable.
Close#10502
* Enable/disable ext column via the context menu.
* The ext column checkbox is removed from the preferences dialog.
* Cleaned up localization file
Fix#10468, close#10485
LexerStylerArray contains a MAX_LEXER_STYLE-element array (currently 100) of LexerStyler objects. Every one of them in turn via inheritance from StyleArray contains a SCE_STYLE_ARRAY_SIZE-element array (I tested with 99) of Style objects each at least 56 bytes in size. This in my test case requires over 550k of memory, and if LexerStylerArray is allocated on stack, the stack becomes corrupted. (Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10454#issuecomment-908732786)
Inline arrays are a part of an object and increase its size while std::vector uses memory from the heap and stores internally only a pointer to a chunk of memory, thus the size of an object with a vector is substantially smaller than the one with an inline array. (Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10454#issuecomment-908780106)
Fix#10454, fix#10206
Follow these commits:
* Substitute "Mark" for "Style" in the menu entries (2576bf884b)
* Update English localization file to v8.1.4 (45831ac050)
Close#10416
When both Windows and Notepad++ use RTL language, the Save/Open button is swapped with Cancel button.
Now take that into account when searching the button.
Fix#10397, close#10400
This PR uses always current buffer's path in Find in Files dialog:
When "Follow current doc." is checked, then use current path first.
If that fails, fallback to the working directory as it was before.
Fix#8045, close#10387
The plugins' toolbar icons can be displayed in both light/dark mode by using their original icons.
Though using new API NPPM_ADDTOOLBARICON_FORDARKMODE to have better look & feel is recommanded.
Fix#9959, fix#10388, fix#9809
There's a security flaw for the un-installation of Notepad++ in Windows Register, the string without quotes:
C:\Program Files\Notepad++\uninstall.exe, whereas it should be "C:\Program Files\Notepad++\uninstall.exe".
The reason is, hacker can create a file called c:\program.exe, then Windows could interpret Files\Notepad++\uninstall.exe as the argument, so the system could run c:\program.exe. Ref:
https://isc.sans.edu/diary/Help+eliminate+unquoted+path+vulnerabilities/14464
Fixed by @ozone10:
Fix#10191, fix#6165, close#10369
Add Markdown UDL of dark mode and the ability to apply it:
After dark mode being swiched in, all files with extension .md will be opened by applying Markdown UDL of dark mode.
When light mode is switched back, the default Markdown UDL (of light mode) will be applied to the new opened .md file.
Please note that all .md files opened before switching to new mode, will remain in the previous mode. User has to close and reopen these files to have the right Markdown UDL applied.
Fix#10196, close#10347
Fix 2 RTL issues:
1. wrong path in tooltip of tab (#8520).
2. the file drag and drop bug (#8730) - now user can drag and drop to the exact view.
Fix#8520, fix#8730, close#10348
Currently, when the shortcut mapper is filtering shortcuts, it doesn't display key conflicts properly. This is due to the indexes of the filtered shortcuts being different (since there are less) than the original list of shortcuts.
Author @jmbockhorst
(the original branch has been deleted)
Fix#5374, close#5453
Pass a pointer to FileDialogEventHandler instance via GWLP_USERDATA
instead of using static variable. This way each window can have its
own pointer.
Fix#10290, close#10303