Skip to content

Commit 3a7021c

Browse files
committed
update to N++ interfaces for 8.6.5 with scintilla 5.4.3 and lexilla 5.3.1
1 parent 3154245 commit 3a7021c

25 files changed

+1120
-259
lines changed

NppPlugin/include/Common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ int OrdinalIgnoreCaseCompareStrings(LPCTSTR sz1, LPCTSTR sz2);
167167

168168
bool str2Clipboard(const generic_string &str2cpy, HWND hwnd);
169169
class Buffer;
170-
bool buf2Clipborad(const std::vector<Buffer*>& buffers, bool isFullPath, HWND hwnd);
170+
bool buf2Clipboard(const std::vector<Buffer*>& buffers, bool isFullPath, HWND hwnd);
171171

172172
generic_string GetLastErrorAsString(DWORD errorCode = 0);
173173

NppPlugin/include/Docking.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of Notepad++ project
2-
// Copyright (C)2021 Don HO <[email protected]>
2+
// Copyright (C)2024 Don HO <[email protected]>
33

44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by
@@ -58,14 +58,14 @@ struct tTbData {
5858
const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations
5959

6060
// internal data, do not use !!!
61-
RECT rcFloat = {}; // floating position
61+
RECT rcFloat = {}; // floating position
6262
int iPrevCont = 0; // stores the privious container (toggling between float and dock)
6363
const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin
6464
};
6565

6666

6767
struct tDockMgr {
68-
HWND hWnd = nullptr; // the docking manager wnd
68+
HWND hWnd = nullptr; // the docking manager wnd
6969
RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs
7070
};
7171

NppPlugin/include/Notepad_plus_msgs.h

Lines changed: 617 additions & 235 deletions
Large diffs are not rendered by default.

NppPlugin/include/PluginInterface.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of Notepad++ project
2-
// Copyright (C)2021 Don HO <[email protected]>
2+
// Copyright (C)2024 Don HO <[email protected]>
33

44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by
@@ -15,12 +15,15 @@
1515
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1616

1717

18+
19+
// For more comprehensive information on plugin communication, please refer to the following resource:
20+
// https://npp-user-manual.org/docs/plugin-communication/
21+
1822
#pragma once
1923

2024
#include "Scintilla.h"
2125
#include "Notepad_plus_msgs.h"
2226

23-
const int nbChar = 64;
2427

2528
typedef const TCHAR * (__cdecl * PFUNCGETNAME)();
2629

@@ -45,9 +48,11 @@ struct ShortcutKey
4548
UCHAR _key = 0;
4649
};
4750

51+
const int menuItemSize = 64;
52+
4853
struct FuncItem
4954
{
50-
TCHAR _itemName[nbChar] = { '\0' };
55+
TCHAR _itemName[menuItemSize] = { '\0' };
5156
PFUNCPLUGINCMD _pFunc = nullptr;
5257
int _cmdID = 0;
5358
bool _init2Check = false;

NppPlugin/include/Scintilla.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,20 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
339339
#define SCI_GETCHARACTERCATEGORYOPTIMIZATION 2721
340340
#define SCI_BEGINUNDOACTION 2078
341341
#define SCI_ENDUNDOACTION 2079
342+
#define SCI_GETUNDOACTIONS 2790
343+
#define SCI_SETUNDOSAVEPOINT 2791
344+
#define SCI_GETUNDOSAVEPOINT 2792
345+
#define SCI_SETUNDODETACH 2793
346+
#define SCI_GETUNDODETACH 2794
347+
#define SCI_SETUNDOTENTATIVE 2795
348+
#define SCI_GETUNDOTENTATIVE 2796
349+
#define SCI_SETUNDOCURRENT 2797
350+
#define SCI_GETUNDOCURRENT 2798
351+
#define SCI_PUSHUNDOACTIONTYPE 2800
352+
#define SCI_CHANGELASTUNDOACTIONTEXT 2801
353+
#define SCI_GETUNDOACTIONTYPE 2802
354+
#define SCI_GETUNDOACTIONPOSITION 2803
355+
#define SCI_GETUNDOACTIONTEXT 2804
342356
#define INDIC_PLAIN 0
343357
#define INDIC_SQUIGGLE 1
344358
#define INDIC_TT 2
@@ -432,6 +446,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
432446
#define SCI_AUTOCGETAUTOHIDE 2119
433447
#define SC_AUTOCOMPLETE_NORMAL 0
434448
#define SC_AUTOCOMPLETE_FIXED_SIZE 1
449+
#define SC_AUTOCOMPLETE_SELECT_FIRST_ITEM 2
435450
#define SCI_AUTOCSETOPTIONS 2638
436451
#define SCI_AUTOCGETOPTIONS 2639
437452
#define SCI_AUTOCSETDROPRESTOFWORD 2270
@@ -875,7 +890,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
875890
#define SC_SEL_LINES 2
876891
#define SC_SEL_THIN 3
877892
#define SCI_SETSELECTIONMODE 2422
893+
#define SCI_CHANGESELECTIONMODE 2659
878894
#define SCI_GETSELECTIONMODE 2423
895+
#define SCI_SETMOVEEXTENDSSELECTION 2719
879896
#define SCI_GETMOVEEXTENDSSELECTION 2706
880897
#define SCI_GETLINESELSTARTPOSITION 2424
881898
#define SCI_GETLINESELENDPOSITION 2425
@@ -1021,6 +1038,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
10211038
#define SCI_CLEARSELECTIONS 2571
10221039
#define SCI_SETSELECTION 2572
10231040
#define SCI_ADDSELECTION 2573
1041+
#define SCI_SELECTIONFROMPOINT 2474
10241042
#define SCI_DROPSELECTIONN 2671
10251043
#define SCI_SETMAINSELECTION 2574
10261044
#define SCI_GETMAINSELECTION 2575

NppPlugin/include/StaticDialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of Notepad++ project
2-
// Copyright (C)2021 Don HO <[email protected]>
2+
// Copyright (C)2024 Don HO <[email protected]>
33

44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by

NppPlugin/include/Window.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of Notepad++ project
2-
// Copyright (C)2021 Don HO <[email protected]>
2+
// Copyright (C)2024 Don HO <[email protected]>
33

44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by

NppPlugin/include/menuCmdID.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of Notepad++ project
2-
// Copyright (C)2021 Don HO <[email protected]>
2+
// Copyright (C)2024 Don HO <[email protected]>
33

44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by
@@ -388,6 +388,8 @@
388388
#define IDM_VIEW_TAB_COLOUR_3 (IDM_VIEW + 113)
389389
#define IDM_VIEW_TAB_COLOUR_4 (IDM_VIEW + 114)
390390
#define IDM_VIEW_TAB_COLOUR_5 (IDM_VIEW + 115)
391+
#define IDM_VIEW_TAB_START (IDM_VIEW + 116)
392+
#define IDM_VIEW_TAB_END (IDM_VIEW + 117)
391393

392394
#define IDM_VIEW_NPC (IDM_VIEW + 130)
393395
#define IDM_VIEW_NPC_CCUNIEOL (IDM_VIEW + 131)
@@ -396,7 +398,8 @@
396398
#define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002
397399
#define IDM_VIEW_GOTO_NEW_INSTANCE 10003
398400
#define IDM_VIEW_LOAD_IN_NEW_INSTANCE 10004
399-
401+
#define IDM_VIEW_GOTO_START 10005
402+
#define IDM_VIEW_GOTO_END 10006
400403

401404
#define IDM_FORMAT (IDM + 5000)
402405
#define IDM_FORMAT_TODOS (IDM_FORMAT + 1)
@@ -589,7 +592,7 @@
589592
// #define IDM_SETTING_HISTORY_SIZE (IDM_SETTING + 3)
590593
// #define IDM_SETTING_EDGE_SIZE (IDM_SETTING + 4)
591594
#define IDM_SETTING_IMPORTPLUGIN (IDM_SETTING + 5)
592-
#define IDM_SETTING_IMPORTSTYLETHEMS (IDM_SETTING + 6)
595+
#define IDM_SETTING_IMPORTSTYLETHEMES (IDM_SETTING + 6)
593596
#define IDM_SETTING_TRAYICON (IDM_SETTING + 8)
594597
#define IDM_SETTING_SHORTCUT_MAPPER (IDM_SETTING + 9)
595598
#define IDM_SETTING_REMEMBER_LAST_SESSION (IDM_SETTING + 10)

NppPlugin/src/StaticDialog.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of Notepad++ project
2-
// Copyright (C)2021 Don HO <[email protected]>
2+
// Copyright (C)2024 Don HO <[email protected]>
33

44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by
@@ -80,10 +80,15 @@ void StaticDialog::goToCenter(UINT swpFlags)
8080
{
8181
RECT rc{};
8282
::GetClientRect(_hParent, &rc);
83+
if ((rc.left == rc.right) || (rc.top == rc.bottom))
84+
swpFlags |= SWP_NOSIZE; // sizing has no sense here
85+
8386
POINT center{};
8487
center.x = rc.left + (rc.right - rc.left)/2;
8588
center.y = rc.top + (rc.bottom - rc.top)/2;
8689
::ClientToScreen(_hParent, &center);
90+
if ((center.x == -32000) && (center.y == -32000)) // https://devblogs.microsoft.com/oldnewthing/20041028-00/?p=37453
91+
swpFlags |= SWP_NOMOVE; // moving has no sense here (owner wnd is minimized)
8792

8893
int x = center.x - (_rc.right - _rc.left)/2;
8994
int y = center.y - (_rc.bottom - _rc.top)/2;

PythonScript/src/ConfigFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void ConfigFile::clearItems()
122122
m_toolbarItems.erase(m_toolbarItems.begin(), m_toolbarItems.end());
123123
}
124124

125-
tstring ConfigFile::expandPathIfNeeded(char *userPath)
125+
tstring ConfigFile::expandPathIfNeeded(char *userPath) const
126126
{
127127
tstring fullPath = L"";
128128
if (userPath)

0 commit comments

Comments
 (0)