Commit Graph

5762 Commits (0e8781938d56744e6afe5fe3c6b6da3fd6f5e9ff)

Author SHA1 Message Date
Don Ho 0e8781938d Add log while flush file buffers action fails
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-2054242025

Close #15003
2024-04-16 01:17:13 +02:00
Christian Grasser 25c6795d0c Code enhancements
- 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
2024-04-15 03:15:59 +02:00
ArkadiuszMichalski 35f601b665 Add ISSUE_TEMPLATE folder to exceptions
ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14999#issuecomment-2054089871

Close #15002
2024-04-15 03:10:09 +02:00
ozone10 045d21aa15 Add additional instructions to issue templates
ref https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14992#issuecomment-2054022134

Close #14999
2024-04-15 03:01:59 +02:00
ozone10 7cfa79b8cd Allow Ctrl-TAB to switch tabs in FindReplace dialog
Fix #14975, close #14988
2024-04-15 02:54:14 +02:00
Don Ho 896d78a5db You can't criticize Roman numeral 11 in China 2024-04-14 22:20:05 +02:00
ArkadiuszMichalski c2696001c2 Allow any character in title/message
Fix https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14943#issuecomment-2053716053

Close #14993, close #14994, close #14995, close #14996, close #14997, close #14998
2024-04-14 15:16:29 +02:00
xomx 126505180f Fix potential crash when crossing the 2GB file size threshold
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
2024-04-14 14:35:26 +02:00
ozone10 80e8a0dbe1 Add dpi messages
- process WM_DPICHANGED_AFTERPARENT message
- remove unused function
- tweak 2 switches, which use enums to avoid warnings

ref #14959

Close #14980
2024-04-14 14:14:28 +02:00
Don Ho 906f6e4386 Revert "Fix Korean IME append extension issue"
This reverts commit 6330a68, due to regression reported in #14400.

Fix #14400, fix #14973, close #14593
2024-04-13 19:41:59 +02:00
ArkadiuszMichalski a5e29863e5 Use newer version of make and show it correctly
Close #14972
2024-04-13 12:05:04 +02:00
ozone10 5a65b30b17 Add issue templates
Fix #14969, close #14970
2024-04-13 10:41:47 +02:00
xomx 18815de8ac Fix multi-edit resists escape after typing issue
Add Multi-Edit mode canceling by Esc possibility

Fix #14649, close #14956
2024-04-13 10:31:04 +02:00
ozone10 e0bb723700 Improve HiDPI compatibility for tab control labels
Close #14958
2024-04-11 18:21:14 +02:00
PeterCJ 8f24e89824 Add syntax highlighting for Go/Golang
(as done in SciTE, Go/Golang can use cpp lexer)

Fix #8090, close #14966
2024-04-11 17:58:43 +02:00
ozone10 5b8e13ab9b Refactor controls in Find & Replace dialog to improve compatibility with HiDPI
Close #14948
2024-04-11 17:02:06 +02:00
ozone10 fc52cd3f4f Use dpi scaled fonts for some controls
-  prepare static dialog for hiDPI

ref: #14959

Close #14947
2024-04-11 11:09:09 +02:00
Don Ho ddc080785d Merge branch 'xomx-fix_possible_2GB+_files_loading_Scintilla_exception' 2024-04-09 19:51:45 +02:00
ArkadiuszMichalski 5f93e046ec Reduce CI build time for some circumstances
Fix #14942, close #14943
2024-04-08 21:26:49 +02:00
Christian Grasser 8d3d8aa642 Fix gcc compiler warnings\errors
- 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
2024-04-07 12:19:52 +02:00
Don Ho 318c9a994c Merge branch 'fix_possible_2GB+_files_loading_Scintilla_exception' of https://github.com/xomx/notepad-plus-plus into xomx-fix_possible_2GB+_files_loading_Scintilla_exception 2024-04-06 15:45:19 +02:00
ozone10 1f4cbdb8b7 Fix close button disappeared issue in Find&Replace dialog
Fix #14940, close #14941
2024-04-05 19:06:23 +02:00
xomx 6afcb73557 Fix possible 2GB+ files loading Scintilla exception
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.
2024-04-05 18:55:07 +02:00
Don Ho 903d47b2eb Reduce compiling warning
Close #14924
2024-04-05 03:46:27 +02:00
ozone10 6204f00e88 Use dark theme on checkbox buttons on Windows 11
-  replace style and class strings with macro

Fix #14929, close #14930
2024-04-03 02:45:38 +02:00
Don Ho a61f3ab13f Update slovenian.xml 2024-04-03 02:29:55 +02:00
molsonkiko 2a6382b4a6 Enhance Notepad++ closing speed by not scanning for URLs
Close #14931
2024-04-03 01:28:41 +02:00
Coises 0a7295878d Fix a performance issue due to URL recognization
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
2024-04-03 01:18:56 +02:00
ozone10 29fcd1ac91 Readd dpi API
ref https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14871#issuecomment-2002547565

Close #14876
2024-04-02 01:44:52 +02:00
ozone10 243112d04d Fix Dark Mode Menu Bar cluttered issue
Use correct enums for dark mode menubar

Fix #14910, fix #10130, close #14911
2024-04-01 17:10:28 +02:00
Don Ho 60034edf37 Fix debug info display regression
This regression was introduced by 83f0232d91

Fix #14921
2024-03-30 23:44:09 +01:00
Don Ho 26647ac9fd Notepad++ release 8.6.5 2024-03-30 01:02:22 +01:00
Don Ho bbeaafac8b Fix period backup crash due to the dead lock of std::lock_guard
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
2024-03-29 16:14:44 +01:00
ozone10 30f48aae1e Insert "change history" styles to Style Configurator for themes if absent
Close #14905
2024-03-27 19:10:19 +01:00
ozone10 b31e7a31e0 Change History GUI enhancement and tweaks
- add 'Go to setting' for other Change History styles
- make spacing consistent in preference
- minor warning fix

Close #14883
2024-03-27 17:08:13 +01:00
Don Ho 12c6777bc1 Fix some "Go to settings" in Style Configurator go to wrong section
Fix #14882, close #14903
2024-03-24 14:06:17 +01:00
Don Ho 52fa5a3b8a Fix Mouse Wheel Scrolling in Shortcut Mapper even nothing to scroll
Reduce also Shortcut Mapper memory use.

Fix #14895, close #14896
2024-03-24 11:25:14 +01:00
Matteo Concato 71a12c4289 [xml] Fix & update italian.xml
Close #14898
2024-03-24 11:21:53 +01:00
molsonkiko cccd99b791 Fix URLs are not detected after a "Replace All" regression
Fix #14864, close #14889
2024-03-21 23:54:52 +01:00
Don Ho d7011c41bf Modernize BabyGrid.cpp
1. Isolate the local variables.
2. Initialize the variables.
3. Prevent negative index in the tables.
4. Rename few variables.

Close #14893
2024-03-21 21:09:36 +01:00
xomx 109600aa50 Enhance losing session while power outrages remedy
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 aa3777786d

Close #14887
2024-03-21 17:55:34 +01:00
Don Ho 0bc28df616 Reformat BabyGrid.cpp for a good readibility and nothing more
Close #14886
2024-03-20 19:26:23 +01:00
xomx 73bc79ee50 Fix launching Shortcut Mapper makes app crash
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
2024-03-20 03:49:32 +01:00
MarkusBodensee 6b0274fdf2 Update german.xml
Update german.xml with latest changes for v8.6.5 release.
Adjust and fix some more translations.

Close #14879
2024-03-19 16:31:05 +01:00
Juan 33ac6e7ecf [xml] Update galician.xml
Close #14873
2024-03-17 19:39:59 +01:00
Juan 13dcdd5fb4 [xml] Update spanish.xml
Close #14872
2024-03-17 19:38:23 +01:00
schnurlos 6e77795f89 [xml] Update german.xml
Close #14803
2024-03-17 19:37:06 +01:00
Andrei Miloiu bdbd289d6c Update romanian.xml
Close #14868
2024-03-17 19:34:21 +01:00
Don Ho 590ea74bee Fix NUL characters file corruption after power outrages (1st step solution)
=========
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-1987037043

Fix #6133, close #14860
2024-03-17 19:23:51 +01:00
Don Ho aa3777786d Remedy losing session problem after the power outrages
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
2024-03-17 17:55:50 +01:00