functionParser.h: add virtual destructor into abstract class.
A memory leak has been found by using PVS-Studio analyzer.
Analyzer warning: V599 The virtual destructor is not present, although the 'FunctionParser' class contains virtual functions.
Closes#3402
How to reproduce the bug:
If the current tab size is smaller then next tab, click on 'x' button to close current tab, then next tab replces the closed tab position. Without move cursor and click on the next tab (now it becomes current tab), clicked tab is closed.
Fixed:
This bug is due to the current tab's information is not updated between 2 clicks.
Update the current hover tab RECT (_currentHoverTabRect) and close hover flag (_isCloseHover), so that x will be highlighted or not based on new _currentHoverTabRect.
Fixes#3004, closes#3340
While D:\test.txt has been opend. And open new Tab (new 1), add random text then save
it as D:\test.txt - 2 different tabs having same file opened and they could have
different content.
The fix checks for opened file existence only in the other view
(either in sub view or in main view), but does not check in same view.
Fixes#3384, Closes#3500
Dropping folder into Notepad++ to have Folder as Workspace not make its
toolbar button activated. This bug is fixed by this commit.
Fixes#3282, closes#3501
Load plugin only when plugin name match to plugin folder name.
For example: "NppPluginDemo.dll" can be loaded only when it in the
folder named "NppPluginDemo".
An issue has been found by using PVS-Studio analyzer.
Analyzer warning: V501 There are identical sub-expressions to the left
and to the right of the '!=' operator: subject != subject.
Closes#3399
A weakness has been found by using PVS-Studio analyzer.
Analyzer warnings:
* V595 The 'pScint' pointer was utilized before it was verified against
nullptr. Check lines: 347, 353. scintillaeditview.cpp 347
* V713 The pointer _langList[i] was utilized in the logical expression
before it was verified against nullptr in the same logical expression.
parameters.h 1286
closes#3400
It seems REBARBANDINFO.cbSize initialization logic got broken after
migration to VS 2013 (last working version - 6.6.9)
That leads to various problems related to toolbar logic (like missing
chevron - #3385 or incorrect plugin toolbar placement #3094)
Closes#3386, fixes#3385, fixes#3094
A popuped message appear for the 1st modification from outside of
Notepad++, if users ignore it and save another change outside, the 2nd
popuped message appears. This commit fix this bad behaviour, which could
lead crash.
Closes#3307
Original code was flawed:
* On +S+H (hidden and system) files, the attributes are set 4 times,
when there's only need for 2 calls.
* When clearing +S bit, it is masked out from the _original_
attribute value, which means that if the +H was cleared previously,
it is set back again. It doesn't seem like this was intended, so
I assume it's a bug.
* When restoring the attributes, there's a pointless OR operation.
Close#2881
winmain: move local functions to anonymous namespace
winmain: remove redundant static keyword
winmain: add newline at the end of file
winmain: move UAC related code to anonymous function
winmain: declare MSGFLT_ADD/MSGFLT_ALLOW only if not already defined
winmain: check only for emptiness
parameters: move winKeyDefs & scintKeyDefs & PGNSI to anonymous names
parameters: remove redundant static/inline keywords
misc: remove unused source code
Closes#3030
Improve behavior when notifying the user about a buffer change (opened file changed or deleted)
- Restore the Notepad++ window and switch to the document in question *before* showing the dialog (this was only done afterwards before)
- Fix flickering issue described in #1018 and #2010 which was exposed by f2cd779066Closes#2956
1. If any session ext is set, then give preference to session ext instead
of "All Types (* . *). This is applicable for both save/load session
methods.
2. Show error message when user tries to load wrong session file (e.g. any
text file which is not a valid session file).
3. Correct typo and wrong description in a messagebox.
Closes#2921
This adds in highlighting for Python 3.5.0+ users who uses "async def" and
"await"'s for coroutines.
These keywords are also planned to change in 3.6.0 as well with PEP-530.
http://www.python.org/dev/peps/pep-0530Closes#2650
- corrections for interface of bufferID, as x64 requires usage of UINT_PTR aka WPARAM instead of INT
- used new EolType instead of formatType
- removed commented NPPM_ADDREBAR, NPPM_UPDATEREBAR, NPPM_REMOVEREBAR not available in n++ code
- corrected typos
Closes#2920
Fixed block uncomment in undoStreamComment func, new argument.
tryBlockComment is to avoid loop call.
Fixed typo in doStreamComment func.
Fixes#1200, fixes#1714, fixes#2125, fixes#2854, closes#2875
If empty column(s) is/are selected in column mode: create a new document
then Alt-Shift + Arrow right key to select, launch colomn mode editor to
insert some number -> NPP crash.
Fixes#2820, Closes#2850
1. GetLastErrorAsString is moved from PluginsManager.cpp to Common.h and common.cpp and also function signature is changed
2. Below method were already defined in common.cpp, but not declared in common.h
generic_string intToString(int val);
generic_string uintToString(unsigned int val);
3. Updated RunDlg.cpp to show error if ShellExecute fails
Closes#2626, Fixes#2179
* Implemented XML Schema for functionList.xml.
* functionList.xml:
1. new layout of association map;
2. placed `displayName` before `id` attribute where applicable;
3. utilize inline comments;
4. parsers added: 'XML for FunctionList', Assembly, AutoIt3, InnoSetup, PowerShell, KRL, Sinumerik and UniVerse BASIC;
5. parsers improved: C, Java, Batch, Bash, XML and NSIS;
6. replaced `[\t\x20]` with `\h` where possible;
7. using upper case notation for hexadecimal values e.g. `\x7F-\xFF`;
Closes#2602
While double-clicking to select or searching with "Match whole word
only" option, the selected characters stop on non-word characters. With
this enhancement, users can include any non-word character into word
characters list, to change its default behaviour.
Preferences... -> Recent Files History -> Don't check at launch time
does not work anymore. If it is unchecked, it will be checked again on
next Notepad++ launch time.
Fixes#2746
In the environment of multi-monitor with a laptop + a stantion, it
happens all the time that users have lost Find dialog after detaching
and retatching - the solution: Ctrl-F twice will get back your Find
dialog.
In Find dialog, the new shortcut of "Find All in Current Document"
buttons (in v7.2.1) has hijacked the one of Replace &All. Here's the
fix for this regression.
Added new VB keywords; all from addhandler to xor are official keywords
of the current VB.NET; those from attribute to unload are legacy
keywords (VB6 etc.); those from aggregate to yiels are not reserved but
still have a special meaning in most cases
Closes#2496
In certain cases (e.g. running the current macro until the end of file) and auto-completion and auto-indentation was not getting turned off, causing certain commands to get interpreted incorrectly. Closes#2553, Closes#2545, Closes#2556
This bug can be reproduce by turning off smart highlight then restart
Notepad++ : some smart highlight options are still enabled.
Fixes#2442, closes#2465
1. For RTL languages such as hebrew, "Close" button goes beyond the dialog.
2. Few Text is chopped (specially ". matches newline" and "Regular expression")
Closes#2337
- Updated file header and `associationMap`-header.
- Changed order of associations and parsers to follow ascending 'langID' numerical values.
- Removed `displayMode` attributes (are not used).
- Make functionList.xml XML compliant.
- Put set of characters in same order in all character groups.
- Correct `)/` to `/)` in `commentExpr`-attribute.
- Add pattern modifier to multi-line comment expression.
- Add pattern modifier to single-line comment expression.
- When applicable remove outer most parentheses of `commentExpr`-attribute.
- As an underscore is part of character class `\w` (equals group `[A-Za-z0-9_]`) remove the underscore when both are used in the same group.
- Replace the `A-Za-z0-9_` set in a group with character class `\w` as they are equal.
- No need to put one character class in a group e.g. change `[\w]` to `\w`.
- Replace space character with its hexdecimal representation i.e. \x20.
- Corrected Python parser i.e. renamed `funcNameExpr` to `nameExpr` in function-parser part.
- Changed use of L_JS (19) to L_JAVASCRIPT (58).
Closes#2335
Fix Folder as Workspace toolbar button inconsist state while closing
Folder as Workspace windows directely (by clicking X button)
Fixes#2249, closes#2263
The new behaviour (by default) is open the folder in "Folder as
Workspace". The old behaviour is open all files in folder (recursively).
Now user can choose it.
Closes#2018, fixes#2016
This commit fixes the issue of notepad++ defaulting to 'Normal text file'
file type when creating new file form the command like:
notepad++.exe new_example_file.cpp
closes#1923, Fixes#1006
-quitOnEmpty command line flag makes Notepad++ to quit when the last tab is closed. Useful for people who use Notead++ for things like editing Git commit messages (using -multiInst -notabbar -nosession), and want to signal they are done editing by closing the tab with Ctrl-W instead of Alt-F4.
Closes#2034
This option configures the vertical scroll range of Scintilla.
Disable this will configure the scroll range to end at last line
(DEFAULT).
Enable this will configure the scroll range to end one page beyond the
last line.
Closes#2032
Added some more Change Case functions (Title Case, Sentence Case,
Invertcase, Randomcase).
Some of them have a normal and a blend version. The normal version will
change any formatting in the start/middle/end part of the word/sentence to
the chosen case. The blend version applies the changes only to the start
part but don't changes the middle/end part of the word/sentence. You can
use it when you want to keep some formatting in the middle/end part, for
instance CamelCase or proper nouns.
Closes#2031
Improved the Single Line Comment/Uncomment/Toggle behaviour for Lexers
with the following condition:
Single Line Comment Symbol : false
Stream Comment Symbol Start : true
Stream Comment Symbol End : true
This includes among others: XML, HTML, CSS, Caml, Pascal, ...
In the current Npp a 'Single Line Comment' will do a 'Block Comment' and
the 'Toggle Single Line Comment' entry does nothing at all for these kind
of Lexers.
This implementation uses the stream comment symbols (start/end) to
accomplish a single line comment,
exactly the same way as the usual Single Line Comment/Uncomment/Toggle
functionality does for Lexers with a single line symbol.
This will add more consistency to the Single Line Comment feature.
NOTE
The selection range behaviour has been revised to be more accurate and for
fixing some 'line leaving' bugs when uncommenting.
Closese #2029
Added a basic conflict detection functionality to the Shortcut Mapper.
This includes:
* Marking conflicts with a different background color.
* Displaying conflict information.
* Warning when attempting to assign an already existing short-key.
Some more related changes to the Shortcut Mapper:
* Fixed some bugs, for instance:
1. Babygrid was shrinking on any attempt to adjust its position to integral
rows.
2. Context menu entries were enabled for empty lists. Using them would crash
Npp.
3. ... some more minor bug fixes.
* Performance enhancements to Babygrid.
* Minor UI improvements.
* Babygrid is configured dpi aware.
Closes#2061
To reproduce such bug, the file foo.txt to monitor should be in the root folder (ie. c:\foo.txt).
The algorithm is check if folder path has '\' at the end, if no, then add a '\' then append file name.
In the original code, instead of checking folder path, the file name is checked. Since file name doesn't contain '\' (ie. c:\temp), a '\' is always added on folder path which has no '\' at the end. it works for none root folder such as C:\, E:\ or F:\.
While trying to save a untitled empty document, user could open a existing
file that erases the untitled document's buffer, then save action make
Notepad++ crash:
https://www.youtube.com/watch?v=balHtvy4TocFixes#1857, Closes#1904
CmdLineParams object of the block "case COPYDATA_PARAMS" is always made
by another instance of Notepad++, (located usually in C:\Program Files
(x86)\Notepad++\) which is launched by NppShell.dll.
If CmdLineParams structure is modified in the local instance, and file
is opened via NppShell.dll, then crash happeds.
Closes#1851
[PowerEditor/src/Parameters.cpp:2581]: (warning) Array index -1 is out of bounds. Otherwise there is useless condition at line 2568.
[PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp:3079]: (style) Unused variable: newline
[PowerEditor/src/WinControls/Grid/BabyGrid.cpp:166]: (style) Array index 'j' is used before limits check.
[PowerEditor/src/WinControls/Grid/BabyGrid.cpp:171]: (style) Array index 'j' is used before limits check.
[scintilla/lexers/LexUser.cxx:1128]: (error) Array 'maskMapper[15]' accessed at index 15, which is out of bounds.