Commit Graph

6030 Commits

Author SHA1 Message Date
Don Ho ba8cd8c46f Add one comment for localization file 2024-10-20 15:05:29 +02:00
Don Ho ad34461261 Make left behide hide line close marker removable
Fix #15713
2024-10-18 03:57:03 +02:00
Adrian Kulawik 5d2bea5b97 Fix hanging issue while hiding lines
Fix #15630, close #15632
2024-10-18 03:55:50 +02:00
Don Ho bfe835e8a4 Fix wrong messages for replacement status 2024-10-16 16:56:26 +02:00
Don Ho 901014746c Fix Find dialog status bar wrong messaging
Fix #15662
2024-10-16 05:27:29 +02:00
Don Ho 1890ea65f9 Avoid user confusion between Global override & Default Styles
Fix #15640, close #15706
2024-10-16 00:49:44 +02:00
Don Ho dc9f58ddac Reduce network file hanging issue due to win32API GetFileAttributes cache (unsynchronized).
STR:
1. Open a network file.
2. Close Notepad++ to have it in the session.
3. Disconnect the network, and launch Notepad++ immediately.
4. Around more than 1 minute's delay, then the "Error" dialog displayed.

The reason for the hanging is that the network file was incorrectly detected by doesFileExist (GetFileAttributesEx) as present, leading Notepad++ to attempt opening a non-existent file with _wfopen. This issue seems to stem from a caching mechanism within the IO function (GetFileAttributesEx). When the network disconnects, the cache is not immediately cleared, causing GetFileAttributesEx to falsely report that the file exists. Consequently, when Notepad++ is launched after a network disconnection, GetFileAttributesEx retains its cache, indicating the file exists, while _wfopen fails to locate the network resource, resulting in a hang.

Unfortunately, there's no efficient solution for this problem. The commit's remedy is to check if the file is on the network and whether its directory still exists. If the directory doesn't exist, we avoid calling _wfopen. We verify the directory's existence instead of the file itself because the cache issue with GetFileAttributesEx occurs before _wfopen is executed. Checking the directory avoids the cache problem due to the identical argument being used.

I've tested this remedy in debug mode, and it works fine. However, the problem persists in release mode. Despite this, I believe it's worth keeping this solution, as it provides some protection in a variable network environment, potentially mitigating the issue when it arises.

Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/15658#issuecomment-2386662974

Improve #4306, #6178, #8055, #11388, #12553, #15540, close #15701
2024-10-15 21:27:44 +02:00
Don Ho 5e3ee3e0e4 Rename variable & enhance the code 2024-10-12 19:32:37 +02:00
Don Ho 3b6f22b357 Fix disconnected network files hanging while saving
This PR prevent hanging when user: Open a network file, modify it. Disconnect the network, then save the file.
It also prevents the zombie process due to blocked CreateFile left behind.

Remove the timeout thread for CreateFile to prevent the zombie process. Use another way for the detection:
If the result of network file existent detection is false, and the network problem found (timeout reached), we just stop and don't call CreateFile routine.

Ref: 1445487

Improve #4306, #6178, #8055, #11388, #12553, #15540
2024-10-12 04:25:09 +02:00
Don Ho 0ca0348e7f Improve code & refactoring
Close #15681
2024-10-11 19:54:11 +02:00
Don Ho cd45afc020 Improve GUI for commands for the system tray in Preferences 2024-10-11 04:28:19 +02:00
p@pawel-pc 035ef19b17 Add "Close to system tray" in MISC preference
Fix #4075, fix #11627, close #15617
2024-10-11 04:21:21 +02:00
Don Ho fdb68db3d6 Fix the wrong detection call 2024-10-10 18:43:42 +02:00
Don Ho 1445487bb7 Fix network files hanging while the network disconnected (part 3)
Add thread for CreateFile to fix saving disconnected network file hanging.
STR: Open a network file, modify it. Disconnect the network, then save the file. A huge latency (more than 1 minute) can be observed.

Not that the crash is not reproducible anymore by this PR. If any crash happens for you, please let me know (with the STR).

Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/15669

Improve #4306, #6178, #8055, #11388, #12553, #15540
Close #15679
2024-10-08 21:08:16 +02:00
Don Ho fb6d79b3af Fix crash on closing a disconnected network file tab
Context: While the network file is disconnected, it's considered non-existent and might to be deleted.

The reason of crash:
"doClose" on the same buffer happens twice while users clicks X button, then chooses "No" when they are asked whether if this file should be kept in editor.

Explanation:
When user clicks X button on the tab of the file in question to close it, "activateBuffer" is called, then "fileClose" is called.
* activateBuffer: Following "activeateBuffer" call in the depth, "checkFileState" is invoked - that leads the message "The file "xxxxxx" doesn't exist anymore. Keep this file in Editor?". If user clicks on No, "doClose" will close the tab and destroy the buffer.
* fileClose: in "fileClose" call, "doClose" will be invoked and try to close the already-destroyed buffer.

Solution:
Retrieve the buffer ID once again, after "activateBuffer" call, for comparing with old buffer ID. If the buffer was destroyed, the new retrieved buffer ID is not the same.

Note: this commit fixes the crash, but it doesn't fix the misbehaviour: If user clicks on "Yes" to answer the message "The file "xxxxxx" doesn't exist anymore. Keep this file in Editor?", the tab will be still closed.

Fix #15684, close #15685
2024-10-08 16:48:52 +02:00
Don Ho d2fb03e41c Make log function easier to be called 2024-10-05 21:47:20 +02:00
Don Ho a3535f385f Fix network files hanging while the network disconnected (part 2)
Refactoring for reducing the I/O calls, fix typos.

Reduce the startup time (while the a dirty disconnected network file is in the session) from about 12-15 seconds to about 6 seconds (on my laptop).

Note that there are 2 cases are not improved by the commit:

* STR 1: Open a network file, modify it. Disconnect the network, then save the file.

There will be a huge hanging time (around 1 minute) to get the warning dialog.
I tried to remedy with thread for CreateFileW in the constructor of Win32_IO_File, however it leads crash due to the lock guard in the caller.

* STR 2:
1. Open a network file.
2. Close Notepad++ to have it in the session.
3. Disconnect the network, and launch Notepad++ immediately.
4. Around more than 1 minute's delay, then the "Error" dialog displayed.

The reason of hanging is that the network file was detected by "doesFileExist" as true, so Notepad++ was trying to open non-existent file (by _wfopen).
I believe that there's some kind of cache during the very short period for the IO function (here's our case GetFileAttributes), and such cache is not immediately synchronized (cleared) while network disconnected. As a result, when we launch Notepad++ after the disconnection of network, GetFileAttributes keeps its memory & responds "FileExists". However for _wfopen it doesn't see the resource of network anymore - that makes hanging.

Ref #15658
Improve #4306, #6178, #8055, #11388, #12553, #15540
Close #15669
2024-10-04 18:04:15 +02:00
Don Ho f884a39dd4 Fix opened network files hanging issue while the network disconnected
The issue is due to WinAPI's GetFileAttributes function can take a huge amount of time in various situations, like when the target server being offline (usalally).
The current solution is to wait at least 3 seconds for each GetFileAttributes function, then return the default value in case of the problem (or the returned value of the function, in case of normal situation - if it has been executed completely during the 3 seconds).
So there'll still be the hanging time (3 or 6 seconds) while the problem of network connection, but the hanging time (it could be 30 seconds more) is reduced considerablly.

"Wow64EnableWow64FsRedirection" call is also removed from x64 build (in which this call is unnecessary) in this commit to reduce the IO calls.

Fix #4306, fix #6178, fix #8055, fix #11388, fix #12553, fix #15540, close #15658
2024-10-02 04:52:15 +02:00
Don Ho fc051a1231 Add tab created time tooltip for new opened untitled tab
Note: while create the new tab (empty & clean), there will be a created time displayed. When the document is modified and period backup feature is enabled, a new created time will be assigned and displayed. However, the time of the first modification which makes empty document dirty will be remained as the tab creation time, even with several modification afterward.

Fix #15563, close #15651
2024-09-26 18:44:45 +02:00
xomx 8baa1553fc Fix regression: can't open folder via cammand argument
Fix one incorrect PathFileExists replacement.

Fix #15645, close #15646
2024-09-23 16:57:15 +02:00
Don Ho 595074152d Small refactoring 2024-09-19 18:38:07 +02:00
Don Ho 27ce5f8499 Notepad++ 8.7 release 2024-09-17 19:36:49 +02:00
Don Ho 4201368cde Fix typo 2024-09-16 13:58:46 +02:00
Don Ho ea08a8929d Fix the crash issue for NPPM_GETNATIVELANGFILENAME
Fix #15627
2024-09-15 18:57:55 +02:00
Karlo-F 45cd29f8ea [xml] Update Croatian translation for Notepad++ 8.7
Close #15608
2024-09-11 15:52:45 +02:00
Juan 8a56d1a4ea [xml] Update galician.xml v. 8.7.0
Close #15589
2024-09-11 15:50:54 +02:00
Juan 291c5c3718 [xml] Update spanish.xml v. 8.7.0
Close #15588
2024-09-11 15:48:37 +02:00
Matteo Concato 8f78f997f8 Update venetian.xml
Close #15491
2024-09-11 15:46:32 +02:00
Sapziller 4728efd5ae Update korean.xml
Close #15483
2024-09-11 15:42:37 +02:00
A. Regnander af3283fcf0 Update swedish.xml
Close #15479
2024-09-11 15:41:20 +02:00
Hugo Carvalho 06d1e8b068 [xml] Update portuguese.xml
Close #15477
2024-09-11 15:36:00 +02:00
Andrei Miloiu ccf5342707 Update romanian.xml
Close #15464
2024-09-11 15:34:01 +02:00
Matteo Concato 22e5c2b82f [xml] Update italian.xml
Close #15446
2024-09-11 15:32:14 +02:00
Marcellomco d932b029f8 [XML] Update brazilian_portuguese.xml
Close #15434
2024-09-11 15:30:13 +02:00
Tmp341 3330661d2a [xml] Update Turkish localization
* According to 912c5ee, 9f6e9c0, 07e9503 and 7a6768b commits.
* Used to [Compare](12548b6..7a6768b (diff-a6ac7ceba70d88bf1547fd1defd760bd55052dcdb78c44f9d46d99ef1f450472))

Close #15432
2024-09-11 15:28:10 +02:00
artpoli 4b0792e7d4 [xml] Update Ukrainian translation
Close #15569
2024-09-10 22:55:23 +02:00
Njardarheim-1337 6308589e7c Update norwegian.xml to 8.6.8
Update norwegian.xml to 8.6.8 according to the last commit.

Close #15419
2024-09-10 22:48:03 +02:00
xomx d942032cf0 [xml] Update czech.xml to v8.7.0
Close #15618
2024-09-10 20:10:45 +02:00
yasmise ba24ac84b7 [xml] Update japanese.xml
Update translation texts for these commits:
* Make C-Like indent deactivatable (439bbb0)
* Improve description for settings "Backup" (108b9f0)
* Add missing localization for debug info dialog and print error (ea5e36a)

Close #15455
2024-09-09 17:56:17 +02:00
Patriccollu ff5c03374d [xml] Update Corsican translation for Notepad++ 8.7
Close #15451
2024-09-09 04:45:03 +02:00
schnurlos 6cbebedb1e [xml] Update german.xml v8.6.9
Close #15438
2024-09-08 18:02:37 +02:00
~GOLEM~ 3e977c38eb [xml] Update russian.xml v8.7.0
Close #15444
2024-09-08 16:32:40 +02:00
kubalav d3ac449432 [xml] Update Slovak translation
Close #15445
2024-09-08 16:22:53 +02:00
rddim 12d46fc61c [xml] Update Bulgarian localization
Close #15458
2024-09-08 16:19:02 +02:00
Don Ho 4393f0ca09 Make naming more accurate 2024-09-07 19:30:43 +02:00
Brian C d5ec03a464 Fix monitoring large file with frequent writes freezes UI issue
Fix #9661, close #15598
2024-09-06 04:19:00 +02:00
Don Ho 624e315686 Add forgotten entries for individual tab color in theme files
Add the entries forgotten in a16261caaa
2024-09-04 03:46:11 +02:00
Christian Grasser a13d4637bf Add simple version of tex/latex function list
Close #15595
2024-09-04 03:17:54 +02:00
Don Ho 85c390efde Fix NPPM_GETNATIVELANGFILENAME's comment documentation & 2 tipos
Fix #15599
2024-09-03 19:20:51 +02:00
Don Ho a9b5235402 Fix CVE-2014-9456 (but it's not a "Security Vulnerability")
Fix Notepad++ Debug binary crash issue while opening some special files (crash after some "Assertion fail" message boxes).
Only the Debug binary is impacted. There's no issue for the release binary, so it's not a "security vulnerability".

Also there's no buffer overflow as the description in CVE-2014-9456.

Fix #12669
2024-09-03 00:24:48 +02:00