Commit Graph

343 Commits

Author SHA1 Message Date
Don Ho aa0be9973b Add support for Change History in the text
This commit follows the commit:
fd1f785b89

Close #14838
2024-03-10 05:17:08 +01:00
Don Ho 35deb8a303 Make "Prevent C0 input" feature optional 2024-02-29 17:51:27 +01:00
Don Ho f2d66170fc Restore multi-editing option on GUI
Make also Column To Multi-editing optional on GUI and cancel the usage of noColumnToMultiSelect.xml file.
For users who have added "noColumnToMultiSelect.xml" for disabling "Column To Multi-editing" feature,
please go to "Editing 2" section of Preferences to disable this feature.

Ref: https://community.notepad-plus-plus.org/topic/25364/notepad-v8-6-2-release/11?_=1707952609907
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14611#issuecomment-1937487607

Fix #14645, close #14734
2024-02-15 18:27:48 +01:00
Don Ho 9e7f1e514c Make copy/cut line while no selection optional
With this commit, there's the same issue in both JsonTools & NavigateTo (in C#), described here:
https://community.notepad-plus-plus.org/topic/25315/notepad-v8-6-1-release/2?_=1706795482129 

To reproduce:
1. Uncheck "Enable Copy/Cut Line without selection" checkbox in Editing section of Preferences.
2. Make sure there's no selection in the current editor
3. Launch "Open JSON tree viewer", and try to Cut "@" symbol on the top left text field with Ctrl-X

To remedy such problem, the plugin should call NPPM_MODELESSDIALOG with MODELESSDIALOGADD on the handle (HWND) of modeless dialog, just after the dialog creation.
(https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h#L93)
With the registration of dialog handle, Notepad++ will pass all events which belongs to dialog's controls to the registered dialog.

Both source code of JsonTools & NavigateTo have been examinated, NPPM_MODELESSDIALOG which should be used has not been called.
Not sure it's the case of all the plugin in C#, it's not the issue for the C/C++ plugins anyway, because the dockable modeless dialog (inherited from StaticDialog) is registered after its creation:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp#L257

Fix #14638, close #14660
2024-02-03 01:29:54 +01:00
Don Ho bb278b26fc Enhance API description in comment
Close #14587
2024-01-28 05:20:22 +01:00
Don Ho 75ae73c173 Fix Copy/Cut/Paste shortcut modification conflict problem
The bug is introduced by:
f7c44b4413

Fix #14585, close #14586
2024-01-14 00:18:58 +01:00
Helge Konetzka 464967e26c Fix clang compilation error
Close #14559
2024-01-10 23:33:03 +01:00
Don Ho 3c4f0f9cb2 Make line copy/cut/delete while no selection optional
By adding disableLineCopyCutDelete.xml in "%APPDATA%\Notepad++\" directory (or in the Notepad++ installed directory in portable mode) to:
1. prevent hard coded Shift-DEL shortcut deletes whole line while no selection.
2. prevent Copy command (Ctrl-C) copies whole line (without selection).
3. prevent Cut command (Ctrl-X) cuts whole line (without selection).
4. add SCI_CUT (Shift-DEL), SCI_COPY (Ctrl-INS) & SCI_PASTE (Shift-INS) shortcuts

Note: the old disableHardCodedShiftDelete.xml (of 53b5055118) is canceled, the new disableLineCopyCutDelete.xml is used instead.

Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14296#issuecomment-1866679990
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14401#issuecomment-1833326429

Close #14513
2023-12-23 04:45:09 +01:00
Don Ho 53b5055118 Make hard-coded shortcut "Shift-DEL" be abled to be disabled
In order to disable the hard-coded shortcut "Shift-DEL" ability (new feature introduced in v8.6) which delete current line while no selection, users must add an empty file named "disableHardCodedShiftDelete.xml", in "%APPDATA%\Notepad++\" directory (or in the Notepad++ installed directory in portable mode) to prevent this behaviour.

Fix #14470, close #14481
2023-12-14 16:58:12 +01:00
Don Ho aef0438180 Make column to multi-select be abled to be disabled
In order to disable the "Column to multi-select" ability (new feature introduced in v8.6), users must add an empty file named "noColumnToMultiSelect.xml", in "%APPDATA%\Notepad++\" directory (or in the Notepad++ installed directory in portable mode) to prevent this behaviour.

ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14296#issuecomment-1848076816

Fix #14464, close #14476
2023-12-13 03:25:33 +01:00
briangood35 bf37d4714f Sort language list in the Preferences dialog
Sort langlist before displaying using custom less than operator.

Fix #14245, close #14443
2023-12-08 19:52:02 +01:00
Don Ho 2724e0ddbb Make RTL per document & remembered across the sessions
This commit adds the ability of RTL/LTR per document (tab), and memorizes RTL setting of each file in the session.xml.

It also adds an attribute "editZoneRTL" in localization XML file. if "RTL" attribute is present and its value is "yes", then user can add  "editZoneRTL" attribute beside, and set the value of the attribute in question to "no", so Notepad++ GUI will be RTL, but Scintilla zone will be LTR by opening files.  Of course, user can set any direction they want afterward, and what they have set on document will be remembered across the sessions.

Fix #9665, fix #9950, fix #14385, close #14431
2023-12-02 17:49:09 +01:00
Don Ho 975d29b30b Enable Direct Write Technology in Scintilla by default
And disable Direct Write under WINE, due to the performance issue.
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/8510
2023-11-18 19:22:59 +01:00
Don Ho dc6bfedb90 Fix Incomplete styler.xml crashes Notepad++ issue
And do some refactoring.

Fix #12101
2023-11-06 00:40:38 +01:00
Don Ho 89278e1dc7 Force to enable multi-select feature in Scintilla 2023-10-30 15:40:49 +01:00
xomx 72c5175b33 Fix missing session invalid error for user session & enhance NPPM_GETNBSESSIONFILES
New specs of NPPM_GETNBSESSIONFILES (which is retro-compatible):

======================
NPPM_GETNBSESSIONFILES

Retrieves the number of files to load in the session sessionFileName. sessionFileName should be a full path name of an xml file.

Parameters:

wParam [out]
BOOL* isValidXML, if this pointer is null, then this parameter will be ignored. TRUE if XML is valid, otherwise FALSE.

lParam [in]
const TCHAR * sessionFileName

Return value:
Returns 0 if sessionFileName is an empty string/NULL, or XML session file is corrupted/invalid, else the number of files.
======================

Other minor improvements:
- checking also for a possible ShellExecute errors
- removing the isAllSuccessful boolean, as it is no longer needed.

Fix #14228, close #14232
2023-10-23 01:09:58 +02:00
Don Ho 08794510be Make session inaccessible files remembered (part 2/2)
Following the commit: 4248c2ae22

If the user enables the option "Remember inaccessible files from past session" (disabled by default), and an opened session (the default session "session.xml" or a user session) contains one or several inaccessible files, a message dialog will appear, giving the user the choice to open or not open the placeholders. If the user chooses to open them, empty and read-only documents will be opened as placeholders for these inaccessible files.

Fix #12079, fix #12744, fix #13696, close #14252
2023-10-23 00:07:00 +02:00
Alan Kilborn 591b00e538 Make auto-checking of Find InSelection configurable (OFF or resizable)
Set value to 0 to disable auto-checking "In Selection" checkbox in Find dialog.
Set any value to define the length of selected characters to auto-check "In Selection" checkbox in Find dialog.
The default and maximum value is 1024.

Fix #14108, fix #13677, fix #12639, close #14175
2023-10-06 00:32:28 +02:00
xomx 939b00a61e Removing unused _isRestartedByOS member variable
This amends the previous #14074 PR.

Close #14171
2023-09-22 19:25:54 +02:00
xomx 87efdf5084 Add Win10+ OS Restart-app feature
It will allow for the Notepad++ to be a "restartable app", like some other SW can do today (eg Google Chrome, Mozilla Firefox or all the Microsoft UWP apps).

This is to create a seamless experience wherein, if you have to reboot your PC, you can now pick back up from where you left off and resume being productive.

The OS app-restart feature needs at least Windows 10 (20H1) and the user has to switch on the "Restart apps" in the system Settings (subsection Accounts > Sign-in options).

Implemented as per previous discussion: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12541#issuecomment-1332662024

To disable this feature, add "noRestartAutomatically.xml" into "%APPDATA%\Notepad++\" or Notepad++ installation directory.

Fix #9722, fix #11721, fix #11934, close #14074
2023-09-21 19:56:53 +02:00
(x*ln(7))⁻¹ cf8ddc18c9 Add supperss 2GB file warning option for x64
Fix #14055, close #14069
2023-08-31 01:16:15 +02:00
Don Ho 2804ac79f0 Fix "Last Used Directory" may not be saved issue
Also change open/save "Last Used Directory" behaviour - on last changed directory changed in open/save dialog dialog instead on pressing OK.

Fix  #13914, close #13918
2023-07-23 10:05:14 +02:00
Don Ho c8020647dd Fix regression: the small size of Notepad++ on its very first launch
Fix regression is due to a367fc1
2023-07-22 11:39:47 +02:00
Don Ho a367fc1b79 Code enhancement: use std::wstring instead of generic_string 2023-07-21 12:11:08 +02:00
molsonkiko ff2179aeca Remember the directory of "Remember last used directory" through sessions
Fix #11326, fix #10901, fix #4961, fix #4119, close #13887
2023-07-21 11:14:01 +02:00
Don Ho 61503a2dcd Add "open new blank document in addition on startup" ability
To enable/disable this feature, go to New Document section of Preferences dialog, and check/uncheck "Always open a new document in addition at startup" checkbox.

Fix #11134, fix #9535, fix #5527, close #13738
2023-06-08 19:16:56 +02:00
Don Ho dba15cfaf3 Fix document language not remembered through sessions issue
Fix document language not remembered through sessions due to languange being hidden from languages menu.

Fix #13743, close #13744
2023-06-06 02:07:19 +02:00
ozone10 776a3fb945 GUI Enhancement: StylerDlg & URLCtrl
-  prefer SystemParametersInfo fonts over DEFAULT_GUI_FONT
-  optimize dark mode
-  fix override warnings

Fix #13705, close #13706
2023-05-30 18:42:51 +02:00
ozone10 b88456764b GUI Enhancement: Tabbar
-  prefer SystemParametersInfo fonts over DEFAULT_GUI_FONT
-  fix inconsistent tab bar size values
-  add initializer
-  fix override warnings

Fix #13701, close #13702
2023-05-25 14:51:48 +02:00
Don Ho fff5f9b24c Add the UTF8 character ability for Run & Macro menu
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13221#issuecomment-1457325172

Fix #12670, fix #13221, fix #13488, close #13538
2023-04-19 02:06:40 +02:00
Don Ho 4934b46bd7 Fix UDL deletion issue
While there are the UDL in the userDefineLangs folder (new system) and a (or some) UDL in "userDefineLang.xml" (old system). The complete UDL deletion in "userDefineLang.xml" not remove "userDefineLang.xml" file.
This PR fixes the problem.

Fix #8101, close #13513
2023-04-13 05:10:03 +02:00
ozone10 0cad36d636 Add hide/show ability of Control Characters (C0 & C1) and Unicode EOL
Fix #8111, close #13324
2023-04-11 15:35:35 +02:00
Alan Kilborn b54b9c49ce Remember "Bookmark Line" and "Purge" options in Mark dlg through the session
Fix #13277, close #13443
2023-03-30 02:36:59 +02:00
Don Ho d37c7c396a Fix value in config.xml does not match user's preference in Column Editor
Fix #13370
2023-03-28 18:09:02 +02:00
Alan Kilborn 7f54a4b959 Add ability to do leading spaces with ColumnEditor
Fix #11148, fix #13309, close #13336
2023-03-25 02:33:09 +01:00
ozone10 269e78bc1e Replace recent file ValueDlg with edit fields & fix DocSwitcher RTL problem
Remove ValueDlg class.

Fix #13244, fix #13248, close #13245
2023-03-06 14:44:50 +01:00
ozone10 caff51c788 GUI enhancement: replace auto-complete link mini dlg with slider
Fix #13162, close #13163
2023-02-21 01:05:12 +01:00
ozone10 37963ea21a Apply tab colors to document list items
and add groups to document list.

Fix #12155, fix #12689, cllose #13080
2023-02-14 14:15:13 +01:00
mpheath 9eab1f566d Add option to make auto-completion list brief
Add filter and recall autocomplete option, so list will be shorter and shorter by adding characters.

Fix #12783, close #13075
2023-02-12 03:01:56 +01:00
ozone10 aaab190763 Add show non-printable characters command
| Name                         | Codepoint | Abbreviation |
|------------------------------|-----------|--------------|
| No-Break Space               | U+00A0    | NBSP         |
| Ogham Space Mark             | U+1680    | OSPM         |
| Mongolian Vowel Separator    | U+180E    | MVS          |
| En Quad                      | U+2000    | NQSP         |
| Em Quad                      | U+2001    | MQSP         |
| En Space                     | U+2002    | ENSP         |
| Em Space                     | U+2003    | EMSP         |
| Three-Per-Em Space           | U+2004    | 3/MSP        |
| Four-Per-Em Space            | U+2005    | 4/MSP        |
| Six-Per-Em Space             | U+2006    | 6/MSP        |
| Figure Space                 | U+2007    | FSP          |
| Punctation Space             | U+2008    | PSP          |
| Thin Space                   | U+2009    | THSP         |
| Hair Space                   | U+200A    | HSP          |
| Zero-Width Space             | U+200B    | ZWSP         |
| Zero-Width Non-Joiner        | U+200C    | ZWNJ         |
| Zero-Width Joiner            | U+200D    | ZWJ          |
| Left-To-Right Mark           | U+200E    | LRM          |
| Right-To-Left Mark           | U+200F    | RLM          |
| Line Separator               | U+2028    | LS           |
| Paragraph Separator          | U+2029    | PS           |
| Left-To-Right Embedding      | U+202A    | LRE          |
| Right-To-Left Embedding      | U+202B    | RLE          |
| Pop Directional Formatting   | U+202C    | PDF          |
| Left-To-Right Override       | U+202D    | LRO          |
| Right-To-Left Override       | U+202E    | RLO          |
| Narrow No-Break Space        | U+202F    | NNBSP        |
| Medium Mathematical Space    | U+205F    | MMSP         |
| Word Joiner                  | U+2060    | WJ           |
| Left-To-Right Isolate        | U+2066    | LRI          |
| Right-To-Left Isolate        | U+2067    | RLI          |
| First Strong Isolate         | U+2068    | FSI          |
| Pop Directional Isolate      | U+2069    | PDI          |
| Inhibit Symmetric Swapping   | U+206A    | ISS          |
| Activate Symmetric Swapping  | U+206B    | ASS          |
| Inhibit Arabic Form Shaping  | U+206C    | IAFS         |
| Activate Arabic Form Shaping | U+206D    | AAFS         |
| National Digit Shapes        | U+206E    | NADS         |
| Nominal Digit Shapes         | U+206F    | NODS         |
| Ideographic Space            | U+3000    | IDSP         |
| Zero-Width No-Break Space    | U+FEFF    | ZWNBSP       |

Fix also issue with tooltips in preference dialog, when changing between dark/light mode.

Fix #827, fix #4731, fix #8284, close #13020
2023-02-05 04:20:25 +01:00
Don Ho 6140865351 Use wide char version's function directely (part2)
ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12613#discussion_r1045153278
2023-01-19 04:12:29 +01:00
ozone10 307fd2fcd2 Add setting for panels to ignore '-nosession'
Fix #9710, close #12699
2022-12-30 20:08:10 +01:00
ozone10 50e95d2267 Code enhancement: Replace undocumented functions
Fix #12721, close #12722
2022-12-29 15:11:05 +01:00
ozone10 6518f3e4b8 Fix theme not changed issue after switching dark/light mode in some cases
1. Fix custom theme (in %APPDATA%) not changing if it is not in default theme dir (in the installation location).
2. Fix default dark theme not applied in dark mode if config is missing (For example, the 1st launch of Notepad++ after its installation).
3. Fix theme not working in cloud issue and portable mode.

Fix #6092, fix #10801, fix #12296, close #12662
2022-12-18 22:15:53 +01:00
ArkadiuszMichalski 4276165bbd Fix themes' inconsistent behaviour after saving
Don't write the fontStyle attribute in the theme if it doesn't exist.

Fix #12642, close #12644
2022-12-15 23:50:11 +01:00
Don Ho f1e1f6be87 Make Run menu organizable with sub-menu
This commit uses the same mechanism (8e85110b5e) for organization of macro menu:
Add attribute `FolderName="sub-menu name"` in "Command" node to have the sub-menu.

Close #12617
2022-12-09 16:34:01 +01:00
Don Ho 8e85110b5e Make macro menu organizable with submenu
This PR allows users to add one level of submenu manually for macro command in shortcuts.xml, in order to better organize macro menu commands.
For doing it, `FolderName="my menu 1"` attribut should be added in <Macro> node. Only 1 level of submenu is allowed.

Here is an example:

```xml
    <Macros>
        <Macro name="aa" Ctrl="no" Alt="no" Shift="no" Key="0">
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="A" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="A" />
        </Macro>
		<Macro name="azerty" Ctrl="no" Alt="no" Shift="no" Key="0" FolderName="words">
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="a" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="z" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="e" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="r" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="t" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="y" />
		</Macro>
		<Macro name="qwerty" Ctrl="no" Alt="no" Shift="no" Key="0" FolderName="words">
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="q" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="w" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="e" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="r" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="t" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="y" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="&#x000D;" />
			<Action type="1" message="2170" wParam="0" lParam="0" sParam="&#x000A;" />
		</Macro>
        <Macro name="BB" Ctrl="no" Alt="no" Shift="no" Key="0">
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="&#x000D;" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="&#x000A;" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="B" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="B" />
        </Macro>
        <Macro name="Trim Trailing Space and Save" Ctrl="no" Alt="yes" Shift="yes" Key="83" FolderName="func">
			<Action type="2" message="0" wParam="42024" lParam="0" sParam="" />
			<Action type="2" message="0" wParam="41006" lParam="0" sParam="" />
		</Macro>
        <Macro name="azerty2" Ctrl="no" Alt="no" Shift="no" Key="0">
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="a" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="z" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="e" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="r" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="t" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="y" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="2" />
        </Macro>
    </Macros>

```

Fix #5349, close #12605
2022-12-07 01:55:15 +01:00
Don Ho aa8ae48b99 Make tab context menu customizable
Use tabContextMenu_example.xml for the customization:

1. rename to tabContextMenu.xml
2. modify it
3. copy it beside notepad++.exe or to %APPDATA%\Notepad++\ according to your Notepad++ conf
4. relaunch Notepad++

Note for the localization:

1. You have to use the newest localization file (or modify your existing localization file with the newest english.xml).
2. The customized sub-menu entry cannot be translated. User can use his/her native language as value of attribute "FolderName" in tabContextMenu.xml file.
3. User can always add any command beyond the default commands in tabContextMenu.xml file. But such command won't be translated.

Fix #12170, close #12576
2022-11-30 15:03:36 +01:00
ozone10 e2a1234384 Dark mode enhancement
1. Add "Follow Windows dark/light mode".
2. Remember user's toolbar, tabbar and theme choices for dark mode and light mode separately.
3. Add 2 hidden options for applying tab background color from themes (for both dark mode and light mode).

Fix #9183, fix #9992, fix #10153, fix #10239, fix #10544, fix #10644, fix #11867, fix #10239, close #12466
2022-11-22 01:54:05 +01:00
xomx 6000f3bb21 Fix session.xml emptying by forced Windows update restart
This fixes both the long standing problem with the emptying of the session.xml file by forced Windows Update restart/shutdown and some potential Notepad++ crashes caused by possible main Notepad++ window blocking at exit.

Two main changes to the original design:
- WM_QUERYENDSESSION is not used anymore for the tidy-up ops and it always quickly returns TRUE/FALSE to the system as it should.
- there is now a safe-guard flag for the session.xml saving at N++ exit, which prevents otherwise possible incorrect overwriting in case of multiple "endsession" messages.

Fix #9850, fix #12389, close #12388
2022-10-30 14:06:33 +01:00