6067 Commits

Author SHA1 Message Date
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 v8.7 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 a16261caaa173689da468d5be66e32866681e152
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
Don Ho
a866900c8d Make find dlg status msgs color customizable via Style Configurator
Fix #5087, close #15597
2024-09-02 18:51:59 +02:00
Don Ho
43ebe796af Add comments for Style Configurator's parameters 2024-09-01 16:56:06 +02:00
Don Ho
21e5350f90 Refactoring for Find dlg Status messge color 2024-08-31 15:00:11 +02:00
Don Ho
22c03102f2 Recognize Cython files as Python
Fix #3069, fix #3767, close #15591
2024-08-31 00:08:36 +02:00
ozone10
bdf3ccaca9 Fix regression of multiple selections in comboboxes of Find dialog
The regression was introduced from commit e25e15b9b25afee7f56fe6e02ef4a314468f6d7b

Fix #15583, close #15587
2024-08-28 20:41:43 +02:00
Don Ho
446cc980e8 Add new plugin command & notification while native lang being changed
Add new plugin notification NPPN_NATIVELANGCHANGED when the native language has been changed, and add new plugin message NPPM_GETNATIVELANGFILENAME for plugins calling after getting NPPN_NATIVELANGCHANGED notification.

Usage of the command:

	#define NPPM_GETNATIVELANGFILENAME (NPPMSG + 116)
	// int NPPM_GETNATIVELANGFILENAME(size_t strLen, char* nativeLangFileName)
	// Get the Current native language file name string.
	// Users should call it with nativeLangFileName as NULL to get the required number of char (not including the terminating nul character),
	// allocate commandLineStr buffer with the return value + 1, then call it again to get the current native language file name string.
	// wParam[in]: strLen is "commandLineStr" buffer length
	// lParam[out]: commandLineStr recieves all copied native language file name string
	// Return the number of char copied/to copy

Usage of the notification:

	#define NPPN_NATIVELANGCHANGED (NPPN_FIRST + 31)  // To notify plugins that the current native language is just changed to another one.
                                                      // Use NPPM_GETNATIVELANGFILENAME to get current native language file name.
                                                      // Use NPPM_GETMENUHANDLE(NPPPLUGINMENU, 0) to get submenu "Plugins" handle (HMENU)
	//scnNotification->nmhdr.code = NPPN_NATIVELANGCHANGED;
	//scnNotification->nmhdr.hwndFrom = hwndNpp
	//scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero

Fix #15513, close #15582
2024-08-28 17:09:40 +02:00
Alan Kilborn
8e26e08c1c Simplify Python smart indent regex
Fix #15573, close #15574
2024-08-26 18:31:22 +02:00
xomx
d2bb7a2af6 Fix a single undo reverting many changes issue
Fix mismatched SCI_BEGINUNDOACTION:
When there is a SCI_BEGINUNDOACTION without the corresponding SCI_ENDUNDOACTION, it then causes that a single undo reverts many changes in at once.

Fix #9426, close #15577
2024-08-26 17:56:29 +02:00
Don Ho
fb11abc5c0 Add TOML configuration file format
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/15564#issuecomment-2305174561

Fix #5631, close #15576
2024-08-26 05:04:06 +02:00
Christian Grasser
b32c07f746 Enhance build in other platforms
Avoid linux issue:
../src/WinControls/DoubleBuffer/DoubleBuffer.cpp:18:10: fatal error: CommCtrl.h: No such file or directory
   18 | #include <CommCtrl.h>
      |          ^~~~~~~~~~~~

Close #15566
2024-08-23 18:03:40 +02:00
ozone10
86adb21480 Improve Styler Configurator performance
ref #15560

Close #15565
2024-08-23 17:56:50 +02:00
Christian Grasser
ad79718fc8 Update to scintilla 5.5.2 & Lexilla 5.4.0
Release 5.5.2 ( https://www.scintilla.org/scintilla552.zip )

    Released 21 August 2024.
    Add SCI_SETCOPYSEPARATOR for separator between parts of a multiple selection when copied to the clipboard. Feature #1530.
    Add SCI_GETUNDOSEQUENCE to determine whether an undo sequence is active and its nesting depth.
    Add SCI_STYLESETSTRETCH to support condensed and expanded text styles.
    Add SCI_LINEINDENT and SCI_LINEDEDENT. Feature #1524.
    Fix bug on Cocoa where double-click stopped working when system had been running for a long time.
    On Cocoa implement more values of font weight and stretch.

Release 5.4.0 ( https://www.scintilla.org/lexilla540.zip )

    Released 21 August 2024.
    Inside Lexilla, LexerModule instances are now const. This will require changes to applications that modify Lexilla.cxx, which may be done to add custom lexers.
    Lexer added for TOML "toml".
    Bash: Handle backslash in heredoc delimiter. Issue #257.
    Progress: Fix lexing of nested comments. Pull request #258.
    Force lower-casing of case-insensitive keyword lists so keywords match in some lexers. Issue #259.

Close #15564
2024-08-23 02:59:58 +02:00
Don Ho
d84f9b2048 Fix Styler Configurator performance issue considerably
Improve Styler Configurator modification application performance considerably.

While one of dockable Panels (Folder as Workspace, for example) is loaded heavily, any action (checkboxes & comboboxes) on Styler Configurator reacts very slowly - for example, check "Bold" in "Font Style".
This commit makes difference among the operations, and optimizes each action in Styler Configurator.

Fix #12436, close #15560
2024-08-21 23:24:29 +02:00