This patch adds an active monitor to detect changes on files since Windows isn't honoring FILE_NOTIFY_CHANGE_SIZE or FILE_NOTIFY_CHANGE_LAST_WRITE on ReadDirectoryChangesW correctly if the file writer keep it opened.
This solution is based on GNU tail for Windows does. It does it at
static void tail_forever (struct File_spec *f, int nfiles, double sleep_interval) on tail.c.
Fix#3142, fix#4955, fix#4527, close#7969
If Windows 10 update needs to restart, and Notepad++ has one (some) dirty document(s), and "Enable session snapshot and periodic backup" is not enabled, then WM_ENDSESSION is send with wParam == FALSE, not waiting for WM_QUERYENDSESSION's treatment finish. In this case Notepad++ should quit after saving its current session.
Fix#6086, fix#5831, fix#7854
Regression: Double click a found in files result while Word-Wrap is on, if file hasn't been opened, then file will be opened but Notepad++ doesn't go to the found word position.
Fix#7865, close#7872
If you switch between tabs while wrap mode is enable, text jump to another lines.
It's an old bug, fixed in v7.5.9, but it had performance regression so it was reverted in v6.0.0.
It's been one year, and I'm back.
This works whatever the size of the file.
There isn't any performance regression because we don't use SCI_ENSUREVISIBLE scintilla command.
In case wrap option on, The restore position function is done in **twice** steps.
- First step: set selection, set anchor, set xoffset...
- Second step: once Scintilla has send the notification SCN_PAINTED, we can scroll several lines to set the first visible line to the correct wrapped line.
Keep in mind that Line wrapping is a background activity that takes time, specially for huge file.
Fix#2078, fix#2576, fix#3570, fix#4825, fix#4881, close#7781
Updater's Proxy settings needs Administrator privilege. This enhancement prevents from launching Updater's Proxy settings and displays an explicite message to user if Notepad++ is not in Admin mode.
Close#7779
File association feature under Windows 10 needs the Administrator's preivilege.
This commit add an explicit message to users who want to use this feature, and disable this feature if Notepad++ has no Administrator's preivilege.
Fix#4984, fix#5192, fix#4542
When there are several files to save, the same doSaveOrNot dialog which cotains 5 buttons (Yes, No, Cancel, Yes to All and No to All) is shown. But if there is only one file to save, then it's better to not show Yes to All and No to All buttons to make a consistent user interface.
Fix#7762
Add "commandLineInterpreter" setting in config.xml
No UI to set it, user has to add the fowllowing line into config.xml:
<GUIConfig name="commandLineInterpreter">powershell</GUIConfig>
(Use your shell to replace powershell)
Close#7737, close#7738
The issue:
While running "close all" command the 2nd save dialog is shown for a unsaved cloned doc, but user has repplyed "No" to the unsaved original doc.
This comit make save dialog show once if user's answer is No.
Fix#7523, close#7558
Fix tab dragging issues related to switching off TCS_BUTTONS under multi-line tabs mode (per AngryGamer's suggestions)
Fix#6274, fix#6273, fix#4339, close#6278
The commit fce74dd894 (which reverts 8342da3) does not solve dragging tab problem(#7509), and it made a regression (#3545 is reproduced again).
This reverts commit fce74dd894.
Old behaviour:
While "Close all but This" operation, if user answer Yes or No for some files to Save dialog, then cancel for a file to save dialog, all files will be kept.
New behaviour:
The files for which user has answered for saving will be close, even the cancel answer at the end.
Fix#7553
Description of the Issue
Improve "Close all to the left/right" functionality.
This is an enhancement request. Similar request was made in past #2555, but has been closed during tracker cleanup process.
Steps to Reproduce the Issue
1. Create 4 tabs says (tab 1, tab 2, tab 3, tab 4)
2. Make all the tab dirty (I mean type, something in each tab, but don't save any).
3. Now right click on tab 1 and choose "Close All to the right"
4. Three popup for asking to save file will appear (For tab 4, tab 3 and tab 2)
5. Click "No" for tab 4 and tab 3. And click cancel for tab 2.
Expected Behavior:
After step 5, tab 4 and tab 3 should be closed. And for Remaining tabs, operation should be cancelled.
Actual Behavior:
Nothing happens after step 5.
Same defect reproduction steps are applicable for "Close all to the left".
Fix#7501, close#7502
In the case of backup feature being disabled, if Notepad++ has a modified file, and it is reduced into the nofitication zone, closing Notepad++ via notification zone will trigger doSave dialog, then Notepad++ stuck after closing the dialog.
Fix#7508
Issue is because of Tool window being used instead of normal window for these 2 dialogs- "Close All" and "Rename"
Known issue already discussed on- https://stackoverflow.com/questions/3760571/showdialog-makes-app-window-disappear-from-windows-alt-tab-list
Excerpt from https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles -
WS_EX_TOOLWINDOW 0x00000080L The window is intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE.
DS_MODALFRAME is added for "Close All" dialog, because after making it normal window, it started showing default empty windows file icon.
Fix#6244, close#6252
x64 installer set installation path in "C:/Program Files/Notepad++/" but "don't use %APPDATA%" is enabled.
This commit fix this issue (make it disabled)
Fix#6243
Fixed command line parsing logic error.
Root cause:
When you double click a file (where NPP has already replaced original Windows Notepad.exe) command like something like below is generated -
-notepadStyleCmdline -z "C:\WINDOWS\system32\NOTEPAD.EXE" F:\FakePath\PowerEditor\bin\change.log
After processing this command line, final command line is left as " F:\FakePath\PowerEditor\bin\change.log while others are ignored. Notice, quote " here just before the actual file path.
Later on, MS PAI ::PathIsRelative treats it as relative path because of quote " rather considering single file. It is expected too as per input to this API.
Now, notepad++ tries to open all the file from path F:\FakePath\PowerEditor\bin\ (in above case) along with file F:\FakePath\PowerEditor\bin\change.log.
Close#6215, fix#6211
The commit 'Make NppParameters singleton "new-less"' make NppParameters instantiate in the stack instead of allocating in the heap:
3dbb2c4b8e
It makes Notepad++ crash:
https://community.notepad-plus-plus.org/topic/18316/notepad-7-8-release-candidate-3/4
The crash is on following code:
vector<MacroShortcut> & vShortcuts = NppParameters::getInstance().getMacroList();
size_t nbItems = vShortcuts.size();
for (size_t itemIndex2 = 0; itemIndex2 < nbItems; ++itemIndex2)
{
...
vShortcuts.size() here return a random large number, which makes crash.
The explanation about vector::size() unexpected behaviour:
https://stackoverflow.com/questions/30548944/c-vector-size-is-wrong-and-higher-than-the-number-of-elements
Obviously the stack size is not large enough to contain NppParameters singleton in 64 bits.
PR #6081 added the required keyword sets for BaanC.
Continuation of #5807 and the last change to enable all available scintilla keyword sets.
Close#6128
Added new window procedures for the HASH_PATH_EDIT/HASH_RESULT_EDIT
and HASH_TEXT_EDIT/HASH_RESULT_FOMTEXT_EDIT controls, where Ctrl+A
is now processed.
Fix#3863, close#3898, close#6034, close#6059
Fix partially "clear all marks in find dialog also removes bookmarks" issue:
* Bookmark line unticked: Clear all marks button press clears only all redmarking
* Bookmark line ticked: Clear all marks button press clears all redmarking and all bookmarks
Fix#3546, close#6042
Fix crash of Folder as Workspace when too many directory changes happen:
Remove limit for amount of queued directory changes: use auto-reset Event instead of Semaphore.
Fix#6005, fix#5907, fix#3740, close#6005
COBOL support in function list - new entries in functionList.xml (note: defaults to fixed-form reference format, manual switch to free-form reference-format possible in association for langID 50)
COBOL support in auto-completion - new file APIs/cobol.xml
COBOL syntax highlighter - recreated list
note: list of statements, functions and reserved words token from GnuCOBOL 3.0 (COBOL85,2002,2014 + extensions from IBM/MF/RM/ACUCOBOL), please report back if any words are missing
Close#4004
When `-nosession` is given as a command line parameter the attribute
`isSnapshotMode` in `config.xml` is overwritten with `no` regardless of
its original value.
<GUIConfig name="Backup" action="0" useCustumDir="no"
dir="" isSnapshotMode="yes" snapshotBackupTiming="7000" />
Change this to keep the original value.
Fix#3938, close#5845
Destroying allocated Scintilla makes Notepad++ crash because created Scintilla view's pointer is added into _referees of Buffer object automatically.
The deallocated scintilla view in _referees is used in Buffer::nextUntitledNewNumber().
So we do nothing here and let Notepad++ destroys allocated Scintilla while it exit and we keep this message for the sake of compability withe the existing plugins.
Fix#4487, close#1500, close#5949
Added 2 new columns showing HTML Code and HTML Name in the Character Panel for ANSI and Windows-1252 character sets.
Modified NM_DBLCLK event to insert in document the current cell value when double clicked in the Character Panel.
Modified translation files for French, English, Spanish and Spanish Argentina to include the new added columns in the Character Panel.
Modified maximum length of the Character Panel title bar in Notepad_plus::launchAnsiCharPanel().
Close#4371
1. Title Bar no longer flickers like crazy.
2. Can interact with other dialogs (such as "Find/Replace dialog" while hovering from tab to tab).
Fix#3324, close#5882
The problem is the way Windows searches for dynamically linked DLLs (Dynamic-Link Library Search Order).
For example, LuaScript.dll is the plug-in DLL, loaded by Notepad++.exe, and lua53.dll is the auxiliary DLL, required by LuaScript.dll and also by user-installed Lua modules. Both DLLs should be located in \plugins\LuaScript. But, when Notepad++ calls LoadLibrary to load LuaScript.dll, Windows will not find the dynamically linked lua53.dll, hence the LoadLibrary call fails. This happens, because Windows will look in the application directory (which is the location of Notepad++.exe), and not in the LuaScript.dll directory.
To make Windows search in the LuaScript.dll directory, Notepad++ needs to call LoadLibraryEx with the LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR flag.
Close#5802, close#5853
Fix crash while sorting the right part of equal sign with column-selection:
100/20 = 5
1/3 = 0.333
22/7 = 3.14285714286
Note that empty lines between the numbers are intentional.
Fix#5865, fix#3391, close#3771
It allows users, while closing files, to reply Yes or No only for once in Save dialog for the all rest of modified files.
Close#5835 , close#4385, close#4392
Code folding block for Nim, VB and YAML includes tailing empty or whitespace only lines,
it's better for these lexers to use SC_IV_LOOKBOTH.
Close#5821
Add the ability to open folders in "folder as workspace" panel via command line argument "-openFoldersAsWorkspace".
Example:
notepad++ -openFoldersAsWorkspace c:\src\myProj01 c:\src\myProj02
The above command will launch notepad++ with folder as workspace panel by opening myProj01 and myProj02 in panel.
Close#4253, close#5100
Fix resizing dockable window (e.g. search result, function list, folder as workspace) and resizing the doc splitter (other view) one after the other issue.
Fix#5516, fix#680, fix#2097, close#5554
Using ^= for the readonly attribute will cause it to always change the bit. So if CLEARREADONLY is called on a file that isn't read only, the file will become read only.
Fix#5768, close#5774
The bug: Drag a short name tab to accross a longger name tab (w/o releasing mouse click) will make a swich - dragging the logger name instead of the shorter name one.
This regression is due to PR "Fix Tab non-responding after dragging bug".
This reverts commit c6e1a95098.
Fix#5072, fix#5450, open #4885
This is an workaround to deal with Microsoft issue in ReadDirectoryChanges notification
If command prompt is used to write file continuously (e.g. ping -t 8.8.8.8 > ping.log)
Then ReadDirectoryChanges does not detect the change.
The workarround is about using Notepad++ notification while Notepad++ getting focus.
Close#5773
How to reproduce:
1. Select a few lines, trigger "Hide lines".
2. Select a few other lines, trigger "Hide lines" as well.
3. Unhide the topmost block by clicking on the appropriate marker.
4. The marker to restore the other block disappear. So the block is still hidden, it cannot be unhidden and there is no more visual indication there are hidden lines!
Fix#1112, Close#5665