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
File manager uses its Scintilla view (with its default document) to save and load file so these 2 op won't be done on foreground.
The fix decreases the reference of document to save correctly while the failure of saving (out of disk space).
Close#5659
This commit makes a performance issue: Re-loading the same text file over and over results in huge memory taken up
This reverts commit 198cf90c16.
Fix#5595
Corsican translation has been updated to take the new strings into account. In addition, apostrophe signs, suspension points and quotation marks have been modified and unnecessary uppercases removed.
Close#5469
cfa702a8a8 (Retain read only flag state in session)
Crash can be reproduced by replacing the content by following code (replace YOUR_FULL_FILE_PATH by your existing full file path):
<NotepadPlus>
<Session activeView="1">
<mainView activeIndex="0" />
<subView activeIndex="0">
<File firstVisibleLine="128" xOffset="0" scrollWidth="8768" startPos="11571" endPos="11571" selMode="0" lang="Normal Text" encoding="-1" filename="YOUR_FULL_FILE_PATH" backupFilePath="" originalFileLastModifTimestamp="-1930112874" originalFileLastModifTimestampHigh="30727970" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="177" mapWrapIndentMode="-1" mapIsWrap="no" />
</subView>
</Session>
</NotepadPlus>
There are several important regression in uchardet to 0.0.6. Hence this revert.
This reverts commit bfb7e863cc.
Fix#5299, fix#5310, fix#5202, fix#5440Close#5414
The current commit contain unstable behaviour and could lead to crash.
OTOH Update Scintilla component will get the same feature. So Scintilla will be updated in short term.
This reverts commit 455fcb2da4.
* Added Ctrl+Shift+D to select next occurence of selection
* Left and right movement works for multiple cursors
* Enter/return a new line works for multiple cursors
Close#5322, close#5399
Fix a long waiting issue about file auto change detection, by adding a new option to avoid an annoying behaviour:
If file content is changed outside of Notepad++, while focus back to Notepad++, the current editing tab will be switched off, the changed file will be switched to and user will be asked to reload the file in question.
The new option remains the editing tab. User will be asked to reload it only if the changed file is switched in.
Fix#1087, Fix#3349, Fix#3333, Fix#3528, Fix#3138, Fix#3934, Fix#3160, Fix#1822, Fix#745, Fix#3599, Fix#4329, Fix#3971, Fix#4592, Fix#1116, Fix#2082Close#4180, Close#5386, Close#4189, Close#1995, Close#2867, Close#3306, Close#2776, Close#2724, Close#2405, Close#4072, Close#4747Close#5389
- corrected xml encoding from UTF8 with BOM -> required UTF8 for zulu and kurdish
- added zulu to localization list, see also #5209
- space -> tab in localizationString.h according to the rest of the list
Close#5209, close#5397
Extend class StringDlg, so that characters which are not allowed in a file name such as |, :, >, < etc. will be restricted for tab's new name so that there will be no problem while saving backup file.
Close#5324
Fixed issue #3776 of splitter panes not being equal due to the widths not taking into account the size of the splitter. Also fixed a spelling error.
Fix#3776, close#5190
Restrict the usage of customized search engine on only "http://" or "https://" url schema to avoid whatever application can be launched via "Search on Internet" command.
New correct behaviour: Dragging out a "new #" document from instance 1 and dropping it into instance 2 makes disappear "new #" document from instance 1, and nothing happens in instance 2.
Several UDL xml files can be loaded to allow to manage/share UDL more easily.
1. The old file userDefineLang.xml is kept in its old location and is still used.
2. The new folder userDefineLangs is added beside of the old UDL default file. Any UDL xml file can go into the folder userDefineLangs and will be loaded as UDL.
3. A UDL xml file must contain one (or several) user defined language(s).
4. The created UDL via UDL dialog and imported UDL are saved in userDefineLang.xml (default UDL file).
https://notepad-plus-plus.org/community/topic/17072/new-enhancement-for-user-defined-language-system
Unexpect behaviour: if "<NppDir>\...dll" and/or "<NppDir>\plugins\..dll" exist, they will be loaded because Notepad++ try to load "<NppDir>\pluginName\pluginName.dll" as plugin, in our case "<NppDir>\plugins\..\...dll" and "<NppDir>\plugins\.\..dll" respectively.
The fix is excluding both directories ".." & "." to not load mentionned above unwanted dll.
Notepad++ launches updater (gup.exe) without checking the signature, that makes exe hacking possible.
The fix is to check updater binary's signature before launching it.
When the amount of clipboard data is too important, it makes crash of function WideCharToMultiByte (win32 API).
The remedy is to capture this error to prevent Notepad++ from crash.
Summary of the Issue:
A remote code execution (RCE) vulnerability was found when a user opens a crafted containing folder in the command line. Code execution is possible by injecting a & followed by system commands into the name of the folder.
Steps to reproduce:
Download the attached archive on Windows: unzip_me.zip (F404758)
Unzip it and navigate into it
Open the txt file inside with Notepad++
Go to File -> Open containing folder -> cmd
Impact statement:
Successful exploitation of this vulnerability would allow an attacker to remotely execute arbitrary commands on the victim's computer.
Inexistent path %APPDATA%\Notepad++\plugins\Config\ made some plugins crash.
In this PR the folder is checked (and created if it doesn't exist) by each launch of Notepad++.
Loading plugin list location is changed from %LOCALAPPDATA%\Notepad++\plugins\Config\ to
%PROGRAMDATA%\Notepad++\plugins\Config\
Enhance API NPPM_GETPLUGINSCONFIGDIR
Close#5037
User @buggalicious found the summary text is displaying a count of characters without line endings not blanks.
Patch should address #3849 by updating the text to describe what is actually being counted.
checked all files of the APIs dir for xml syntax issues and corrected the invalid files
Tested with plugin tools and checked also against https://www.xmlvalidation.com/
The current invalid xml syntax seems to have no bad influence on the functionality of the files.
Notepad++ loads plugins only from 2 locations:
1. %PROGRAMDATA%\Notepad++\plugins\ - while Notepad++ installed on: %PROGRAMFILES%\Notepad++\ or wherever without doLocalConf.xml
2. <NPP_INST_DIR>\plugins\ - while Notepad++ installed on wherever (except in %PROGRAMFILES%\Notepad++\) with doLocalConf.xml
- Fixed "Chinglish" Grammar (Original Chinese translator's defence: they are not "Chinglish", they are good Chinese translations which are not accepted by "normal people", who lakes the imagination and creactivity)
- Unified Translation for some terms
- `$STR_REPLACE` -> `$STR_REPLACE$`
- Added Several Translation
While plugins are in %PROGRAMDATA%, we need admin's rights to modify them. This PR detects the plugins installation in %PROGRAMDATA%, then launch wingup with UAC.
This PR contains three types of changes:
1. Actual bug fix. This bug appeared, because prior to closing files, "Close all but this" attempts to save modified files, and for that it needs to switch views. Those views were not restored after that, however - so further actions could end up being executed on a wrong view. Those are changed commented with // We may have to restore previous view after saving new files.
2. Another potential bug fix. Closing files in both views could result in views being switched (it may or may not, I did not manage to unambiguously find that out from the code). To prevent any possible issues, I stored view IDs in viewNo. If those could never switch, then the code changes nothing - but if they could, it fixes a potential bug.
3. Code clarity fix in Notepad_plus::switchEditViewTo. std::swap makes it more obvious this code is there only to swap values around!
Fixes#4911, Close#4920
Use the _isFolding flag to fix several overlooked edge case hangs.
This pull request fixes additional hangs I found after #4867 when working with deeply-nested fully-folded files. The hangs are easy to reproduce by following these steps:
Download the sample file https://raw.githubusercontent.com/notepad-plus-plus/notepad-plus-plus/master/PowerEditor/src/Parameters.cpp
Open the downloaded file by itself in NPP and fold it using Alt-0
Create a new empty tab and remain focused on it
Perform the six actions below, each of which will produce a hang as NPP tries to change focus back to the first tab. On my machine, each hang lasts about 30 seconds. After control returns, refocus the empty tab again and try the next action.
Use File>>Open to reopen the downloaded file, even though it is already open
Drag and drop the downloaded file onto NPP to reopen it
Double-click the downloaded file to reopen it
Right-click the downloaded file and select Edit with Notepad++ in the context menu
Open the downloaded file from the command line: C:\Program Files (x86)\Notepad++\notepad++.exe" .\Parameters.cpp
Click the red [X] in the upper right corner to close NPP
After applying the patch, none of the hangs should happen any more.
Close#4999
This PR fixes UTF-8 detection for 4 byte characters (a 2002 code used by npp assumed characters longer than 3 bytes are invalid -.-). This means such files will not be erroreously displayed as ANSI anymore.
Steps to reproduce:
Create a new UTF-8 file (w/out BOM)
Paste eg. this character 🍪 and save.
Reopen the file again.
Prior to this PR, file is detected as ANSI (even if Notepad++ is configured to default-assume UTF-8!!!). After this fix, file gets opened as UTF-8 correctly.
Fixes#4730, Fixes#3986, Fixes#3441, Fixes#3405, Closes#4922
The new message NPPM_GETPLUGINHOMEPATH allows plugins to get plugin home root path. It's useful if plugins want to get its own path by appending <pluginFolderName> which is the name of plugin without extension part.
Simply plugins loading emplacement:
NPPM_GETAPPDATAPLUGINSALLOWED to check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed.
If doLocalConf no
else yes
1. Load plugins only from the new plugin folder structure. example: Notepad++\plugins\myAwesomePlugin\myAwesomePlugin.dll
2. Load plugins from only one directory. If doLocalConf.xml is present, then it will be <NPP_INSTALLATION_DIR>\plugins\
otherwise %USERPROFILE%\AppData\Local\Notepad++\plugins\
Old installation behaviour is loading installed plugins without restart Notepad++, which could make some plugins loading uncomplete.
New behaviour use the same implementation of plugin updating, witch quit notepad++ for plugin installation then restart Notepad++.
For the sake of retro-compatibility, change the way of plugin packaging:
1. The plugin DLL file should be placed at the root level of the ZIP file. It has to be the only DLL file on this level.
2. The root level of the ZIP file can also contain additional files and folders which will be copied to the users harddisk as well.
3. Everything what gets copied from the ZIP file will be stored under <Npp-installation-folder>\plugins\<plugin-name>.